@@ -90,7 +90,7 @@ of this software and associated documentation files (the "Software"), to deal
90
90
* </ul>
91
91
*
92
92
* @author JSON.org
93
- * @version 2012-04-20
93
+ * @version 2012-05-29
94
94
*/
95
95
public class JSONObject {
96
96
@@ -1497,7 +1497,9 @@ public Writer write(Writer writer) throws JSONException {
1497
1497
1498
1498
static final Writer writeValue (Writer writer ,Object value ,
1499
1499
int indentFactor ,int indent )throws JSONException ,IOException {
1500
- if (value instanceof JSONObject ) {
1500
+ if (value ==null ||value .equals (null )) {
1501
+ writer .write ("null" );
1502
+ }else if (value instanceof JSONObject ) {
1501
1503
((JSONObject )value ).write (writer ,indentFactor ,indent );
1502
1504
}else if (value instanceof JSONArray ) {
1503
1505
((JSONArray )value ).write (writer ,indentFactor ,indent );
@@ -1520,8 +1522,6 @@ static final Writer writeValue(Writer writer, Object value,
1520
1522
throw new JSONException (e );
1521
1523
}
1522
1524
writer .write (o !=null ?o .toString () :quote (value .toString ()));
1523
- }else if (value ==null ||value .equals (null )) {
1524
- writer .write ("null" );
1525
1525
}else {
1526
1526
quote (value .toString (),writer );
1527
1527
}