Add null checks to fix querier panic

This commit is contained in:
Marcus Cobden
2018-05-03 17:00:09 +01:00
parent d19b0293f6
commit 8eb9fc86ae

View File

@@ -74,6 +74,12 @@ func (n NodeSet) Delete(ids ...string) NodeSet {
// UnsafeMerge combines the two NodeSets, altering n
func (n *NodeSet) UnsafeMerge(other NodeSet) {
if other.psMap == nil {
return
}
if n.psMap == nil {
n.psMap = ps.NewMap()
}
other.psMap.ForEach(func(key string, otherVal interface{}) {
n.psMap = n.psMap.UnsafeMutableSet(key, otherVal)
})