Browse Source

nil related

related to https://github.com/chrislusf/seaweedfs/issues/1676
Chris Lu 4 years ago
parent
commit
9c9ba3c209
1 changed files with 4 additions and 1 deletions
  1. 4 1
      weed/topology/data_node.go

+ 4 - 1
weed/topology/data_node.go

@@ -151,7 +151,10 @@ func (dn *DataNode) GetVolumesById(id needle.VolumeId) (storage.VolumeInfo, erro
 }
 
 func (dn *DataNode) GetDataCenter() *DataCenter {
-	return dn.Parent().Parent().(*NodeImpl).value.(*DataCenter)
+	rack := dn.Parent()
+	dcNode := rack.Parent()
+	dcValue := dcNode.GetValue()
+	return dcValue.(*DataCenter)
 }
 
 func (dn *DataNode) GetRack() *Rack {