aboutsummaryrefslogtreecommitdiff
path: root/src/org
diff options
context:
space:
mode:
authornativbarak <nativ@globekeeper.com>2018-02-07 09:56:41 +0200
committernativbarak <nativ@globekeeper.com>2018-02-07 09:56:41 +0200
commit3a0a269dca63dacc1199cc738aacdfb2c2ecc7bf (patch)
treed2ff689ee646385729dea19278084b2a1531cf4a /src/org
parentda1f01f9367e882b90b495cfae9b67d71e0cf1bb (diff)
downloadtrackermap-server-3a0a269dca63dacc1199cc738aacdfb2c2ecc7bf.tar.gz
trackermap-server-3a0a269dca63dacc1199cc738aacdfb2c2ecc7bf.tar.bz2
trackermap-server-3a0a269dca63dacc1199cc738aacdfb2c2ecc7bf.zip
remove unnecasseray checks
Diffstat (limited to 'src/org')
-rw-r--r--src/org/traccar/WebDataHandler.java13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/org/traccar/WebDataHandler.java b/src/org/traccar/WebDataHandler.java
index 5a0aab3e4..f7a7222d8 100644
--- a/src/org/traccar/WebDataHandler.java
+++ b/src/org/traccar/WebDataHandler.java
@@ -146,17 +146,10 @@ public class WebDataHandler extends BaseDataHandler {
protected String prepareJsonPayload(Position position) {
Map<String, Object> data = new HashMap<>();
+ Device device = Context.getIdentityManager().getById(position.getDeviceId());
- if (position != null) {
- data.put(KEY_POSITION, position);
- }
-
- if (position.getDeviceId() != 0) {
- Device device = Context.getIdentityManager().getById(position.getDeviceId());
- if (device != null) {
- data.put(KEY_DEVICE, device);
- }
- }
+ data.put(KEY_POSITION, position);
+ data.put(KEY_DEVICE, device);
try {
return Context.getObjectMapper().writeValueAsString(data);