aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/model
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-07-30 10:08:04 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-07-30 10:08:04 +1200
commitd97c74a7cf0efe5f4209e31a998b97fc1be8023b (patch)
tree9b9ba9473a8f1e7f2a8928bce6329d47cc9b6e04 /src/org/traccar/model
parent173699d5683605e72267b24a248085c2abccc38f (diff)
parent66dbefa18290d2f31d545fd1f511207cdcd7c3a2 (diff)
downloadtrackermap-server-d97c74a7cf0efe5f4209e31a998b97fc1be8023b.tar.gz
trackermap-server-d97c74a7cf0efe5f4209e31a998b97fc1be8023b.tar.bz2
trackermap-server-d97c74a7cf0efe5f4209e31a998b97fc1be8023b.zip
Merge pull request #1322 from demianalonso/devices-position
Service call to retrieve a group of devices
Diffstat (limited to 'src/org/traccar/model')
-rw-r--r--src/org/traccar/model/MiscFormatter.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/org/traccar/model/MiscFormatter.java b/src/org/traccar/model/MiscFormatter.java
index d1e1ae959..7a1e69082 100644
--- a/src/org/traccar/model/MiscFormatter.java
+++ b/src/org/traccar/model/MiscFormatter.java
@@ -15,6 +15,8 @@
*/
package org.traccar.model;
+import org.traccar.web.JsonConverter;
+
import java.text.DecimalFormat;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -73,6 +75,10 @@ public class MiscFormatter {
json.add(entry.getKey(), (Double) entry.getValue());
} else if (entry.getValue() instanceof Boolean) {
json.add(entry.getKey(), (Boolean) entry.getValue());
+ } else if (entry.getValue() == null) {
+ json.add(entry.getKey(), JsonValue.NULL);
+ } else {
+ json.add(entry.getKey(), JsonConverter.objectToJson(entry.getValue()));
}
}