mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-17 04:19:32 +00:00
Add null checks to fix querier panic
This commit is contained in:
@@ -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)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user