diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-20 10:11:11 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-11-20 10:11:11 +1300 |
commit | ffd0d7f5a60b33ba45c22210d4ba5f07f2a6d789 (patch) | |
tree | 268436e22bcc507d2a240c5c73cdfac353d3c424 /src/org/traccar | |
parent | 4c9466f694e48b69a14e9039bd9b8d717c3a3dc3 (diff) | |
download | traccar-server-ffd0d7f5a60b33ba45c22210d4ba5f07f2a6d789.tar.gz traccar-server-ffd0d7f5a60b33ba45c22210d4ba5f07f2a6d789.tar.bz2 traccar-server-ffd0d7f5a60b33ba45c22210d4ba5f07f2a6d789.zip |
Check if device exists before update
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/database/ConnectionManager.java | 4 |
1 files changed, 4 insertions, 0 deletions
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); |