Browse Source

[MOD] fix a bug.if node is nil will get an panic.

pull/288/head
张远浩 9 years ago
parent
commit
7a7f4cecbb
  1. 2
      go/topology/node.go

2
go/topology/node.go

@ -211,8 +211,8 @@ func (n *NodeImpl) LinkChildNode(node Node) {
func (n *NodeImpl) UnlinkChildNode(nodeId NodeId) {
node := n.children[nodeId]
node.SetParent(nil)
if node != nil {
node.SetParent(nil)
delete(n.children, node.Id())
n.UpAdjustVolumeCountDelta(-node.GetVolumeCount())
n.UpAdjustActiveVolumeCountDelta(-node.GetActiveVolumeCount())

Loading…
Cancel
Save