From ffd0d7f5a60b33ba45c22210d4ba5f07f2a6d789 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 20 Nov 2015 10:11:11 +1300 Subject: Check if device exists before update --- src/org/traccar/database/ConnectionManager.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/org') diff --git a/src/org/traccar/database/ConnectionManager.java b/src/org/traccar/database/ConnectionManager.java index ae931151d..e03fd1663 100644 --- a/src/org/traccar/database/ConnectionManager.java +++ b/src/org/traccar/database/ConnectionManager.java @@ -81,6 +81,10 @@ public class ConnectionManager { public synchronized void updateDevice(final long deviceId, String status, Date time) { Device device = Context.getIdentityManager().getDeviceById(deviceId); + if (device == null) { + return; + } + device.setStatus(status); if (time != null) { device.setLastUpdate(time); -- cgit v1.2.3