mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-03 03:15:32 -04:00
Improved the logic for checking the length of key
This commit is contained in:
parent
31ff8a2291
commit
5b531faa49
@ -1558,7 +1558,7 @@ public class JSONObject {
|
||||
// if the first letter in the key is not uppercase, then skip.
|
||||
// This is to maintain backwards compatibility before PR406
|
||||
// (https://github.com/stleary/JSON-java/pull/406/)
|
||||
if (key.length() > 0 && Character.isLowerCase(key.charAt(0))) {
|
||||
if (key.length() == 0 || Character.isLowerCase(key.charAt(0))) {
|
||||
return null;
|
||||
}
|
||||
if (key.length() == 1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user