mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-03 17:49:40 +00:00
deal with null timepoints in device mapping events
This commit is contained in:
1 parent
53ef9027c9
commit
cbe875af35
2 files changed
+9
-5
No files matched your search
+3
-1
@@ -204,7 +204,9 @@ public class DomainObjectFactoryImpl implements DomainObjectFactory {
|
||||
}
|
||||
|
||||
private TimePoint loadTimePoint(DBObject object, FieldNames field) {
|
||||
return new MillisecondsTimePoint(((Number) object.get(field.name())).longValue());
|
||||
Object loaded = object.get(field.name());
|
||||
if (loaded == null) return null;
|
||||
return new MillisecondsTimePoint(((Number) loaded).longValue());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+6
-4
@@ -811,10 +811,12 @@ public class MongoObjectFactoryImpl implements MongoObjectFactory {
|
||||
e.printStackTrace();
|
||||
}
|
||||
result.put(FieldNames.DEVICE_ID.name(), deviceId);
|
||||
TimePoint from = event.getFrom() == null ? new MillisecondsTimePoint(Long.MIN_VALUE) : event.getFrom();
|
||||
TimePoint to = event.getTo() == null ? new MillisecondsTimePoint(Long.MAX_VALUE) : event.getTo();
|
||||
storeTimePoint(from, result, FieldNames.RACE_LOG_FROM);
|
||||
storeTimePoint(to, result, FieldNames.RACE_LOG_TO);
|
||||
if (event.getFrom() != null) {
|
||||
storeTimePoint(event.getFrom(), result, FieldNames.RACE_LOG_FROM);
|
||||
}
|
||||
if (event.getTo() != null) {
|
||||
storeTimePoint(event.getTo(), result, FieldNames.RACE_LOG_TO);
|
||||
}
|
||||
}
|
||||
|
||||
private Object storeRaceLogDeviceCompetitorMappingEvent(DeviceCompetitorMappingEvent event) {
|
||||
|
||||
Reference in new issue
Block a user