mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #3989 from ioito/hotfix/qx-disk-reset
fix: avoid index out of range
This commit is contained in:
@@ -737,7 +737,11 @@ func (self *SDisk) PerformDiskReset(ctx context.Context, userCred mcclient.Token
|
||||
}
|
||||
|
||||
autoStart := jsonutils.QueryBoolean(data, "auto_start", false)
|
||||
return nil, self.StartResetDisk(ctx, userCred, snapshot.Id, autoStart, &guests[0], "")
|
||||
var guest *SGuest = nil
|
||||
if len(guests) > 0 {
|
||||
guest = &guests[0]
|
||||
}
|
||||
return nil, self.StartResetDisk(ctx, userCred, snapshot.Id, autoStart, guest, "")
|
||||
}
|
||||
|
||||
func (self *SDisk) StartResetDisk(
|
||||
|
||||
Reference in New Issue
Block a user