From 5a4fb657a8eca50e612b772611a2439ff23dab50 Mon Sep 17 00:00:00 2001 From: Douglas Crockford Date: Thu, 25 Aug 2011 08:52:30 -0700 Subject: [PATCH] JSONArray.optString when NULL --- JSONArray.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/JSONArray.java b/JSONArray.java index 6cfc8e7..ec6eff5 100755 --- a/JSONArray.java +++ b/JSONArray.java @@ -78,7 +78,7 @@ import java.util.Map; * * @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; }