mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-30 18:23:35 +08:00
避免nil指针访问
This commit is contained in:
@@ -1175,7 +1175,10 @@ func (self *SGuest) PerformRebuildRoot(ctx context.Context, userCred mcclient.To
|
||||
|
||||
func (self *SGuest) GetTemplateId() string {
|
||||
gdc := self.CategorizeDisks()
|
||||
return gdc.Root.GetTemplateId()
|
||||
if gdc.Root != nil {
|
||||
gdc.Root.GetTemplateId()
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (self *SGuest) StartRebuildRootTask(ctx context.Context, userCred mcclient.TokenCredential, imageId string, needStop, autoStart bool, passwd string, resetPasswd bool, allDisk bool) error {
|
||||
|
||||
Reference in New Issue
Block a user