aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-09-23 09:48:24 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-09-23 09:48:24 +1200
commitf70d8c57d354438192357c3a0435a8f48183aafe (patch)
tree69c1b2981caf1804097b72b4b7de698042df3680
parentec04b5f12e13f041262c179fa103b7e4694d7327 (diff)
downloadtrackermap-server-f70d8c57d354438192357c3a0435a8f48183aafe.tar.gz
trackermap-server-f70d8c57d354438192357c3a0435a8f48183aafe.tar.bz2
trackermap-server-f70d8c57d354438192357c3a0435a8f48183aafe.zip
Fix data handler first position crash
-rw-r--r--src/org/traccar/DefaultDataHandler.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/org/traccar/DefaultDataHandler.java b/src/org/traccar/DefaultDataHandler.java
index cb35baceb..594961389 100644
--- a/src/org/traccar/DefaultDataHandler.java
+++ b/src/org/traccar/DefaultDataHandler.java
@@ -26,7 +26,7 @@ public class DefaultDataHandler extends BaseDataHandler {
try {
Context.getDataManager().addPosition(position);
Position lastPosition = Context.getConnectionManager().getLastPosition(position.getDeviceId());
- if (position.getFixTime().compareTo(lastPosition.getFixTime()) > 0) {
+ if (lastPosition == null || position.getFixTime().compareTo(lastPosition.getFixTime()) > 0) {
Context.getDataManager().updateLatestPosition(position);
}
} catch (Exception error) {