diff options
author | nativbarak <nativ@globekeeper.com> | 2018-02-07 11:09:30 +0200 |
---|---|---|
committer | nativbarak <nativ@globekeeper.com> | 2018-02-07 11:09:30 +0200 |
commit | 56669ce1a869d7a1e2ebda0ecf1d38174026bab9 (patch) | |
tree | 354f6013191979b042878a9f0a73301b54c8c399 | |
parent | f41ed8f9569ec1cd63f5e4a48f8ee81be51b7fb7 (diff) | |
download | traccar-server-56669ce1a869d7a1e2ebda0ecf1d38174026bab9.tar.gz traccar-server-56669ce1a869d7a1e2ebda0ecf1d38174026bab9.tar.bz2 traccar-server-56669ce1a869d7a1e2ebda0ecf1d38174026bab9.zip |
Fixed correct checks
-rw-r--r-- | src/org/traccar/WebDataHandler.java | 9 |
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); |