mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
Merge pull request #7149 from rainzm/automated-cherry-pick-of-#7147-upstream-release-3.2
Automated cherry pick of #7147: fix: mo.VirtualMachine's Config maybe nil
This commit is contained in:
@@ -253,7 +253,7 @@ func (dc *SDatacenter) fetchVms(vmRefs []types.ManagedObjectReference, all bool)
|
||||
for i := 0; i < len(vms); i += 1 {
|
||||
if all || !strings.HasPrefix(vms[i].Entity().Name, api.ESXI_IMAGE_CACHE_TMP_PREFIX) {
|
||||
vmObj := NewVirtualMachine(dc.manager, &vms[i], dc)
|
||||
if vms[i].Config.Template {
|
||||
if vms[i].Config != nil && vms[i].Config.Template {
|
||||
templateVMs = append(templateVMs, vmObj)
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user