mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-02 11:05:28 -04:00
JSONArray.optString when NULL
This commit is contained in:
parent
ce2f5ed80a
commit
5a4fb657a8
@ -78,7 +78,7 @@ import java.util.Map;
|
||||
* </ul>
|
||||
|
||||
* @author JSON.org
|
||||
* @version 2011-05-04
|
||||
* @version 2011-08-25
|
||||
*/
|
||||
public class JSONArray {
|
||||
|
||||
@ -555,7 +555,7 @@ public class JSONArray {
|
||||
*/
|
||||
public String optString(int index, String defaultValue) {
|
||||
Object object = opt(index);
|
||||
return object != null ? object.toString() : defaultValue;
|
||||
return JSONObject.NULL.equals(object) ? object.toString() : defaultValue;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user