From 9e1f577c081b9c43ea71635cf28587ba31609de5 Mon Sep 17 00:00:00 2001 From: ioito Date: Sat, 27 Apr 2019 17:06:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=81=BF=E5=85=8Dnil=E6=8C=87=E9=92=88?= =?UTF-8?q?=E8=AE=BF=E9=97=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/compute/models/guest_actions.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/compute/models/guest_actions.go b/pkg/compute/models/guest_actions.go index 5ab4cc8793..cca7a00439 100644 --- a/pkg/compute/models/guest_actions.go +++ b/pkg/compute/models/guest_actions.go @@ -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 {