Merge pull request #583 from ek08/fix

Checked the length of key for checker framework
This commit is contained in:
Sean Leary 2021-02-01 19:48:06 -06:00 committed by GitHub
commit 7844eb79cd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1558,7 +1558,7 @@ public class JSONObject {
// if the first letter in the key is not uppercase, then skip. // if the first letter in the key is not uppercase, then skip.
// This is to maintain backwards compatibility before PR406 // This is to maintain backwards compatibility before PR406
// (https://github.com/stleary/JSON-java/pull/406/) // (https://github.com/stleary/JSON-java/pull/406/)
if (Character.isLowerCase(key.charAt(0))) { if (key.length() == 0 || Character.isLowerCase(key.charAt(0))) {
return null; return null;
} }
if (key.length() == 1) { if (key.length() == 1) {