mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-17 07:50:52 -07:00
getString("null")
This commit is contained in:
parent
87c4b1d59d
commit
449641a01e
2 changed files with 6 additions and 4 deletions
|
@ -78,7 +78,7 @@ import java.util.Map;
|
|||
* </ul>
|
||||
|
||||
* @author JSON.org
|
||||
* @version 2010-12-24
|
||||
* @version 2010-12-28
|
||||
*/
|
||||
public class JSONArray {
|
||||
|
||||
|
@ -322,7 +322,8 @@ public class JSONArray {
|
|||
* @throws JSONException If there is no value for the index.
|
||||
*/
|
||||
public String getString(int index) throws JSONException {
|
||||
return get(index).toString();
|
||||
Object object = get(index);
|
||||
return object == JSONObject.NULL ? null : object.toString();
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue