Merge pull request #3156 from weaveworks/fix-panic-maybe

Add null check to fix querier panic
This commit is contained in:
Marcus Cobden
2018-05-03 17:25:33 +01:00
committed by GitHub

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)
})