aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authornativbarak <nativ@globekeeper.com>2018-02-07 11:09:30 +0200
committernativbarak <nativ@globekeeper.com>2018-02-07 11:09:30 +0200
commit56669ce1a869d7a1e2ebda0ecf1d38174026bab9 (patch)
tree354f6013191979b042878a9f0a73301b54c8c399 /src/org
parentf41ed8f9569ec1cd63f5e4a48f8ee81be51b7fb7 (diff)
downloadtraccar-server-56669ce1a869d7a1e2ebda0ecf1d38174026bab9.tar.gz
traccar-server-56669ce1a869d7a1e2ebda0ecf1d38174026bab9.tar.bz2
traccar-server-56669ce1a869d7a1e2ebda0ecf1d38174026bab9.zip
Fixed correct checks
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/WebDataHandler.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/org/traccar/WebDataHandler.java b/src/org/traccar/WebDataHandler.java
index f7a7222d8..adc82486c 100644
--- a/src/org/traccar/WebDataHandler.java
+++ b/src/org/traccar/WebDataHandler.java
@@ -148,8 +148,13 @@ public class WebDataHandler extends BaseDataHandler {
Map<String, Object> data = new HashMap<>();
Device device = Context.getIdentityManager().getById(position.getDeviceId());
- data.put(KEY_POSITION, position);
- data.put(KEY_DEVICE, device);
+ if (position != null) {
+ data.put(KEY_POSITION, position);
+ }
+
+ if (device != null) {
+ data.put(KEY_DEVICE, device);
+ }
try {
return Context.getObjectMapper().writeValueAsString(data);