aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/DeviceManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-08-11 23:37:16 +1200
committerGitHub <noreply@github.com>2017-08-11 23:37:16 +1200
commit30e8409375f9992a5248f7e2597691c0ee08188c (patch)
treeea51b7d111cfae849d23941ad82045139e87520b /src/org/traccar/database/DeviceManager.java
parent3562e0d927d539a1e9730c48ed376ee84ebc2b25 (diff)
parent26db3ccc2ed5d43a0e791a29d5cc4afca192e4b7 (diff)
downloadtrackermap-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.java7
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) {