This commit is contained in:
TangBin
2018-10-30 17:13:57 +08:00
parent 754a8eb488
commit d4fcbde56d
+1 -1
View File
@@ -203,7 +203,7 @@ func (self *SRegion) GetImageStatus(imageId string) (ImageStatusType, error) {
func getRootDiskSize(image *ec2.Image) (int, error) {
rootDeivce := *image.RootDeviceName
for _, volume := range image.BlockDeviceMappings {
if *volume.DeviceName == rootDeivce {
if len(rootDeivce) > 0 && *volume.DeviceName == rootDeivce {
return int(*volume.Ebs.VolumeSize), nil
}
}