aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
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 /src/org/traccar
parentec04b5f12e13f041262c179fa103b7e4694d7327 (diff)
downloadtraccar-server-f70d8c57d354438192357c3a0435a8f48183aafe.tar.gz
traccar-server-f70d8c57d354438192357c3a0435a8f48183aafe.tar.bz2
traccar-server-f70d8c57d354438192357c3a0435a8f48183aafe.zip
Fix data handler first position crash
Diffstat (limited to 'src/org/traccar')
-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) {