From bd8f5c8392fc6f28381170d029f67801789fd78d Mon Sep 17 00:00:00 2001 From: Billingsly Wetherfordshire Date: Thu, 19 Jun 2014 13:00:11 -0500 Subject: [PATCH] json.== handles nil now --- lib/pure/json.nim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/pure/json.nim b/lib/pure/json.nim index 4e369b854d..871713f1ce 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: