From 2e803ec9cf4408d77ec950785bb7b6ad18894eae Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Tue, 21 Aug 2018 17:52:24 +0100 Subject: [PATCH] Fixes #520. --- src/nimblepkg/packageinfo.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nimblepkg/packageinfo.nim b/src/nimblepkg/packageinfo.nim index 10e8bfa..e6e3726 100644 --- a/src/nimblepkg/packageinfo.nim +++ b/src/nimblepkg/packageinfo.nim @@ -107,8 +107,8 @@ proc requiredField(obj: JsonNode, name: string): string = ## Queries ``obj`` for the required ``name`` string. ## ## Aborts execution if the field does not exist or is of invalid json type. - result = optionalField(obj, name, nil) - if result == nil: + result = optionalField(obj, name) + if result.len == 0: raise newException(NimbleError, "Package in packages.json file does not contain a " & name & " field.")