From f04986289a83ad1a953eb76868fe9cb9979b3821 Mon Sep 17 00:00:00 2001 From: Farshid Tavakolizadeh Date: Thu, 18 Jun 2020 11:36:36 +0200 Subject: [PATCH] check pointer before looking into child, fixes #26 --- catalog/controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalog/controller.go b/catalog/controller.go index f54d1ac3..28de9496 100644 --- a/catalog/controller.go +++ b/catalog/controller.go @@ -222,7 +222,7 @@ func getObjectFromXPathNode(n *xpath.Node) interface{} { return basicTypeFromXPathStr(n.Data) } - if n.FirstChild.Data == "" { // in case of array, there will be no key + if n.FirstChild != nil && n.FirstChild.Data == "" { // in case of array, there will be no key retArray := make([]interface{}, 0) for child := n.FirstChild; child != nil; child = child.NextSibling { retArray = append(retArray, getObjectFromXPathNode(child))