From 568fe0abdc5a9c4f0dafe2793029239b76b16591 Mon Sep 17 00:00:00 2001 From: ramsestom Date: Fri, 20 Apr 2018 06:01:32 +0200 Subject: [PATCH 1/2] fix issue with Nulls treated as Strings --- src/ca/weblite/codename1/json/JSONObject.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ca/weblite/codename1/json/JSONObject.java b/src/ca/weblite/codename1/json/JSONObject.java index df9f48a..e869a44 100644 --- a/src/ca/weblite/codename1/json/JSONObject.java +++ b/src/ca/weblite/codename1/json/JSONObject.java @@ -32,6 +32,8 @@ of this software and associated documentation files (the "Software"), to deal import java.util.List; import java.util.Map; +import ca.weblite.codename1.json.JSONObject.Null; + /** * A JSONObject is an unordered collection of name/value pairs. Its * external form is a string wrapped in curly braces with colons between the @@ -1191,6 +1193,9 @@ static String valueToString(Object value) throws JSONException { if (value == null ) { return "null"; } + if (value instanceof Null) { + return value.toString(); + } if (value instanceof JSONString) { Object o; try { From 46788af65176290b6c83053e751abad8a09c51e6 Mon Sep 17 00:00:00 2001 From: ramsestom Date: Fri, 20 Apr 2018 07:06:39 +0200 Subject: [PATCH 2/2] fix issue with Nulls treated as Strings --- src/ca/weblite/codename1/json/JSONObject.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ca/weblite/codename1/json/JSONObject.java b/src/ca/weblite/codename1/json/JSONObject.java index e869a44..87a2713 100644 --- a/src/ca/weblite/codename1/json/JSONObject.java +++ b/src/ca/weblite/codename1/json/JSONObject.java @@ -32,7 +32,6 @@ of this software and associated documentation files (the "Software"), to deal import java.util.List; import java.util.Map; -import ca.weblite.codename1.json.JSONObject.Null; /** * A JSONObject is an unordered collection of name/value pairs. Its