diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-23 09:48:24 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-23 09:48:24 +1200 |
commit | f70d8c57d354438192357c3a0435a8f48183aafe (patch) | |
tree | 69c1b2981caf1804097b72b4b7de698042df3680 /src/org | |
parent | ec04b5f12e13f041262c179fa103b7e4694d7327 (diff) | |
download | traccar-server-f70d8c57d354438192357c3a0435a8f48183aafe.tar.gz traccar-server-f70d8c57d354438192357c3a0435a8f48183aafe.tar.bz2 traccar-server-f70d8c57d354438192357c3a0435a8f48183aafe.zip |
Fix data handler first position crash
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/DefaultDataHandler.java | 2 |
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) { |