Skip to content

Commit 31ff8a2

Browse files
committed
Checked the length of key for checker framework
1 parent e33f463 commit 31ff8a2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/org/json/JSONObject.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1558,7 +1558,7 @@ private static String getKeyNameFromMethod(Method method) {
15581558
// if the first letter in the key is not uppercase, then skip.
15591559
// This is to maintain backwards compatibility before PR406
15601560
// (https://github.com/stleary/JSON-java/pull/406/)
1561-
if (Character.isLowerCase(key.charAt(0))) {
1561+
if (key.length() > 0 && Character.isLowerCase(key.charAt(0))) {
15621562
return null;
15631563
}
15641564
if (key.length() == 1) {

0 commit comments

Comments
 (0)