diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-08-11 23:37:16 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-11 23:37:16 +1200 |
commit | 30e8409375f9992a5248f7e2597691c0ee08188c (patch) | |
tree | ea51b7d111cfae849d23941ad82045139e87520b /src/org/traccar/database/DeviceManager.java | |
parent | 3562e0d927d539a1e9730c48ed376ee84ebc2b25 (diff) | |
parent | 26db3ccc2ed5d43a0e791a29d5cc4afca192e4b7 (diff) | |
download | trackermap-server-30e8409375f9992a5248f7e2597691c0ee08188c.tar.gz trackermap-server-30e8409375f9992a5248f7e2597691c0ee08188c.tar.bz2 trackermap-server-30e8409375f9992a5248f7e2597691c0ee08188c.zip |
Merge pull request #3431 from Abyss777/delayed_overspeed
Implement delayed overspeed events
Diffstat (limited to 'src/org/traccar/database/DeviceManager.java')
-rw-r--r-- | src/org/traccar/database/DeviceManager.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/org/traccar/database/DeviceManager.java b/src/org/traccar/database/DeviceManager.java index 3b7e5c617..a485d6dc6 100644 --- a/src/org/traccar/database/DeviceManager.java +++ b/src/org/traccar/database/DeviceManager.java @@ -392,7 +392,12 @@ public class DeviceManager extends BaseObjectManager<Device> implements Identity } public DeviceState getDeviceState(long deviceId) { - return deviceStates.get(deviceId); + DeviceState deviceState = deviceStates.get(deviceId); + if (deviceState == null) { + deviceState = new DeviceState(); + deviceStates.put(deviceId, deviceState); + } + return deviceState; } public void setDeviceState(long deviceId, DeviceState deviceState) { |