Skip to content

Commit 5a4fb65

Browse files
JSONArray.optString when NULL
1 parent ce2f5ed commit 5a4fb65

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

JSONArray.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ of this software and associated documentation files (the "Software"), to deal
7878
* </ul>
7979
8080
* @author JSON.org
81-
* @version 2011-05-04
81+
* @version 2011-08-25
8282
*/
8383
public class JSONArray {
8484

@@ -555,7 +555,7 @@ public String optString(int index) {
555555
*/
556556
public String optString(int index, String defaultValue) {
557557
Object object = opt(index);
558-
return object != null ? object.toString() : defaultValue;
558+
return JSONObject.NULL.equals(object) ? object.toString() : defaultValue;
559559
}
560560

561561

0 commit comments

Comments
 (0)