From 4c658feb2e8fa1017e5f9666a736fb7e92576387 Mon Sep 17 00:00:00 2001 From: Joel Cooklin Date: Fri, 10 Jun 2016 19:56:24 -0700 Subject: [PATCH] Fixes #988 - Plugins with multiple config policy nodes may cause a panic --- pkg/ctree/tree.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/ctree/tree.go b/pkg/ctree/tree.go index 8c85c0ea9..3e67fa138 100644 --- a/pkg/ctree/tree.go +++ b/pkg/ctree/tree.go @@ -161,6 +161,10 @@ func (c *ConfigTree) Get(ns []string) Node { childNodes := child.get(remain) *retNodes = append(*retNodes, *childNodes...) } + if len(*retNodes) == 0 { + // There are no child nodes with configs so we return + return nil + } c.log(fmt.Sprintf("nodes to merge count (%d)\n", len(*retNodes))) // Call Node.Merge() sequentially on the retNodes