Merge pull request #288 from bluefoxah/master

[MOD] fix a bug.if node is nil will get an panic.
This commit is contained in:
Chris Lu 2016-04-11 07:43:20 -07:00
commit 6c5eddaf1d

View file

@ -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())