Skip to content

Commit

Permalink
Fixes intelsdi-x#988 - Plugins with multiple config policy nodes may …
Browse files Browse the repository at this point in the history
…cause a panic
  • Loading branch information
jcooklin committed Jun 11, 2016
1 parent 1d87e72 commit 4c658fe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/ctree/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4c658fe

Please sign in to comment.