Update json.nim
Fixed a bug with json.[], which caused a segfault on debug builds.
This commit is contained in:
parent
d927eb5854
commit
13542572ab
1 changed files with 1 additions and 1 deletions
|
|
@ -669,7 +669,7 @@ proc len*(n: PJsonNode): int =
|
|||
proc `[]`*(node: PJsonNode, name: string): PJsonNode =
|
||||
## Gets a field from a `JObject`, which must not be nil.
|
||||
## If the value at `name` does not exist, returns nil
|
||||
assert(node != nil)
|
||||
assert(not isNil(node))
|
||||
assert(node.kind == JObject)
|
||||
for key, item in items(node.fields):
|
||||
if key == name:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue