We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 30c1bd1 commit 71c6dd1Copy full SHA for 71c6dd1
1 file changed
JSONWriter.java
@@ -325,14 +325,14 @@ public static String valueToString(Object value) throws JSONException {
325
return "null";
326
}
327
if (value instanceof JSONString) {
328
- Object object;
+ String object;
329
try {
330
object = ((JSONString) value).toJSONString();
331
} catch (Exception e) {
332
throw new JSONException(e);
333
334
- if (object instanceof String) {
335
- return (String) object;
+ if (object != null) {
+ return object;
336
337
throw new JSONException("Bad value from toJSONString: " + object);
338
0 commit comments