summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorBillingsly Wetherfordshire <phowl.mouth@gmail.com>2014-06-19 13:00:11 -0500
committerBillingsly Wetherfordshire <phowl.mouth@gmail.com>2014-06-19 13:00:11 -0500
commitbd8f5c8392fc6f28381170d029f67801789fd78d (patch)
tree986600122c975ce5266b054c5634ce3866d28e74 /lib
parentbe534279da5021aa5e6621430a52ee1573f1a01f (diff)
downloadNim-bd8f5c8392fc6f28381170d029f67801789fd78d.tar.gz
json.== handles nil now
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/json.nim8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/pure/json.nim b/lib/pure/json.nim
index 4e369b854..871713f1c 100644
--- a/lib/pure/json.nim
+++ b/lib/pure/json.nim
@@ -621,9 +621,13 @@ proc `%`*(elements: openArray[PJsonNode]): PJsonNode =
 
 proc `==`* (a,b: PJsonNode): bool =
   ## Check two nodes for equality
-  if a.kind != b.kind: false
+  if a.isNil:
+    if b.isNil: return true
+    return false
+  elif b.isNil or a.kind != b.kind: 
+    return false
   else:
-    case a.kind
+    return case a.kind
     of JString:
       a.str == b.str
     of JInt: