diff --git a/JSONObject.java b/JSONObject.java index 7795fbe..6580251 100644 --- a/JSONObject.java +++ b/JSONObject.java @@ -250,8 +250,10 @@ public class JSONObject { * the JSONObject. */ public JSONObject(Map m) { - this.map = new HashMap(m == null ? 0 : m.size()); - if (m != null) { + if (m == null) { + this.map = new HashMap(); + } else { + this.map = new HashMap(m.size()); for (final Entry e : m.entrySet()) { final Object value = e.getValue(); if (value != null) {