From f70d8c57d354438192357c3a0435a8f48183aafe Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 23 Sep 2015 09:48:24 +1200 Subject: Fix data handler first position crash --- src/org/traccar/DefaultDataHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/org') 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) { -- cgit v1.2.3