* fix #15835

* add tests
This commit is contained in:
flywind
2020-11-04 14:24:40 +08:00
committed by GitHub
parent b0e26d8fbf
commit 7d640e0943
2 changed files with 19 additions and 0 deletions

View File

@@ -1052,6 +1052,8 @@ when defined(nimFixedForwardGeneric):
dst = jsonNode.bval
proc initFromJson(dst: var JsonNode; jsonNode: JsonNode; jsonPath: var string) =
if jsonNode == nil:
raise newException(KeyError, "key not found: " & jsonPath)
dst = jsonNode.copy
proc initFromJson[T: SomeInteger](dst: var T; jsonNode: JsonNode, jsonPath: var string) =