Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
check pointer before looking into child, fixes #26
Browse files Browse the repository at this point in the history
  • Loading branch information
farshidtz committed Jun 18, 2020
1 parent 260fb23 commit f049862
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion catalog/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit f049862

Please sign in to comment.