region: fix get disk detail panic

This commit is contained in:
Zexi Li
2019-10-17 16:07:50 +08:00
parent a9938bbe61
commit 8f6c309e30
+1 -1
View File
@@ -919,7 +919,7 @@ func (self *SDisk) validateDeleteCondition(ctx context.Context, isPurge bool) er
return httperrors.NewForbiddenError("not allow to delete prepaid disk in valid status")
}
storage := self.GetStorage()
if storage.StorageType == api.STORAGE_RBD {
if storage != nil && storage.StorageType == api.STORAGE_RBD {
scnt, err := self.GetSnapshotCount()
if err != nil {
return err