From 7a7f4cecbb6937d496ca6abf14450bf9e475a77e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=BF=9C=E6=B5=A9?= Date: Mon, 11 Apr 2016 18:17:22 +0800 Subject: [PATCH] [MOD] fix a bug.if node is nil will get an panic. --- go/topology/node.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/topology/node.go b/go/topology/node.go index 3b6d55ce9..f48f18236 100644 --- a/go/topology/node.go +++ b/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())