Skip to content

Commit f68bcc9

Browse files
author
mtanana
committed
Update JSONObject.java
1 parent 34f327e commit f68bcc9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

JSONObject.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,9 @@ public JSONObject accumulate(String key, Object value) throws JSONException {
387387
testValidity(value);
388388
Object object = this.opt(key);
389389
if (object == null) {
390-
this.put(key,
391-
value instanceof JSONArray ? new JSONArray().put(value)
392-
: value);
390+
//this is the modified line The old version would put the raw value
391+
//this forces an array when the accumulate version is used
392+
this.put(key, new JSONArray().put(value));
393393
} else if (object instanceof JSONArray) {
394394
((JSONArray) object).put(value);
395395
} else {

0 commit comments

Comments
 (0)