aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/http/JsonConverter.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-05-10 18:11:40 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-05-10 18:11:40 +1200
commitbd09a39f12c4471bdc342e5a16fbabdffdc645d1 (patch)
treedb94476ee604c2026c5653975c526352093d5628 /src/org/traccar/http/JsonConverter.java
parent953852e6e984f8a639cf1a5ac4116fff755d538a (diff)
downloadtrackermap-server-bd09a39f12c4471bdc342e5a16fbabdffdc645d1.tar.gz
trackermap-server-bd09a39f12c4471bdc342e5a16fbabdffdc645d1.tar.bz2
trackermap-server-bd09a39f12c4471bdc342e5a16fbabdffdc645d1.zip
Refactor web app architecture
Diffstat (limited to 'src/org/traccar/http/JsonConverter.java')
-rw-r--r--src/org/traccar/http/JsonConverter.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/http/JsonConverter.java b/src/org/traccar/http/JsonConverter.java
index 0802fb9ea..f7c5a5622 100644
--- a/src/org/traccar/http/JsonConverter.java
+++ b/src/org/traccar/http/JsonConverter.java
@@ -29,6 +29,7 @@ import javax.json.JsonArray;
import javax.json.JsonArrayBuilder;
import javax.json.JsonObject;
import javax.json.JsonObjectBuilder;
+import javax.json.JsonValue;
import org.traccar.model.Factory;
public class JsonConverter {
@@ -57,7 +58,9 @@ public class JsonConverter {
} else if (parameterType.equals(int.class)) {
method.invoke(object, json.getJsonNumber(name).intValue());
} else if (parameterType.equals(long.class)) {
- method.invoke(object, json.getJsonNumber(name).longValue());
+ if (json.get(name).getValueType() == JsonValue.ValueType.NUMBER) {
+ method.invoke(object, json.getJsonNumber(name).longValue());
+ }
} else if (parameterType.equals(double.class)) {
method.invoke(object, json.getJsonNumber(name).doubleValue());
} else if (parameterType.equals(String.class)) {