Skip to content

Commit b258ea3

Browse files
authored
Merge pull request stleary#1008 from eleumik/eleumik-patch-1007-array
Update JSONArray.java for stleary#1007
2 parents a5e234a + 9de3005 commit b258ea3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/org/json/JSONArray.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ public JSONArray(JSONTokener x, JSONParserConfiguration jsonParserConfiguration)
105105
if (nextChar == 0) {
106106
// array is unclosed. No ']' found, instead EOF
107107
throw x.syntaxError("Expected a ',' or ']'");
108+
} else if (nextChar==',' && jsonParserConfiguration.isStrictMode()) {
109+
throw x.syntaxError("Array content starts with a ','");
108110
}
109111
if (nextChar != ']') {
110112
x.back();

0 commit comments

Comments
 (0)