This commit is contained in:
Dominik Picheta 2018-08-21 17:52:24 +01:00
commit 2e803ec9cf

View file

@ -107,8 +107,8 @@ proc requiredField(obj: JsonNode, name: string): string =
## Queries ``obj`` for the required ``name`` string. ## Queries ``obj`` for the required ``name`` string.
## ##
## Aborts execution if the field does not exist or is of invalid json type. ## Aborts execution if the field does not exist or is of invalid json type.
result = optionalField(obj, name, nil) result = optionalField(obj, name)
if result == nil: if result.len == 0:
raise newException(NimbleError, raise newException(NimbleError,
"Package in packages.json file does not contain a " & name & " field.") "Package in packages.json file does not contain a " & name & " field.")