Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checked the length of key for checker framework #583

Merged
merged 2 commits into from Feb 2, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/org/json/JSONObject.java
Expand Up @@ -1558,7 +1558,7 @@ private static String getKeyNameFromMethod(Method method) {
// 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 (Character.isLowerCase(key.charAt(0))) {
if (key.length() > 0 && Character.isLowerCase(key.charAt(0))) {
return null;
}
if (key.length() == 1) {
Expand Down