mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-31 02:43:41 +00:00
Update json.nim
Fixed a bug with json.[], which caused a segfault on debug builds.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user