aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/http/JsonConverter.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-05-06 23:33:12 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-05-06 23:33:12 +1200
commitf119326f307635dddc6306d4f5a4e349e808b48a (patch)
tree3c04943e57947b10ac08e4772ac17e38b66611f0 /src/org/traccar/http/JsonConverter.java
parent80e166430b79df771abc73e55892dc9f5fd0b2f1 (diff)
downloadtrackermap-server-f119326f307635dddc6306d4f5a4e349e808b48a.tar.gz
trackermap-server-f119326f307635dddc6306d4f5a4e349e808b48a.tar.bz2
trackermap-server-f119326f307635dddc6306d4f5a4e349e808b48a.zip
Display markers on the map
Diffstat (limited to 'src/org/traccar/http/JsonConverter.java')
-rw-r--r--src/org/traccar/http/JsonConverter.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/org/traccar/http/JsonConverter.java b/src/org/traccar/http/JsonConverter.java
index 48fd934b7..0802fb9ea 100644
--- a/src/org/traccar/http/JsonConverter.java
+++ b/src/org/traccar/http/JsonConverter.java
@@ -93,9 +93,15 @@ public class JsonConverter {
} else if (method.getReturnType().equals(double.class)) {
json.add(name, (Double) method.invoke(object));
} else if (method.getReturnType().equals(String.class)) {
- json.add(name, (String) method.invoke(object));
+ String value = (String) method.invoke(object);
+ if (value != null) {
+ json.add(name, value);
+ }
} else if (method.getReturnType().equals(Date.class)) {
- json.add(name, dateFormat.format((Date) method.invoke(object)));
+ Date value = (Date) method.invoke(object);
+ if (value != null) {
+ json.add(name, dateFormat.format(value));
+ }
}
} catch (IllegalAccessException error) {
} catch (InvocationTargetException error) {