mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-06 18:55:30 +08:00
Improved the logic for checking the length of key
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user