mirror of https://github.com/apache/cloudstack.git
Fix NPE on scale VM operation after the corresponding template is deleted (#5736)
This commit is contained in:
parent
965316b842
commit
4beca925d7
|
|
@ -3990,7 +3990,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||
if (currentServiceOffering.isDynamic() && !newServiceOffering.isDynamic()) {
|
||||
removeCustomOfferingDetails(vmId);
|
||||
}
|
||||
VMTemplateVO template = _templateDao.findById(vmForUpdate.getTemplateId());
|
||||
VMTemplateVO template = _templateDao.findByIdIncludingRemoved(vmForUpdate.getTemplateId());
|
||||
boolean dynamicScalingEnabled = _userVmMgr.checkIfDynamicScalingCanBeEnabled(vmForUpdate, newServiceOffering, template, vmForUpdate.getDataCenterId());
|
||||
vmForUpdate.setDynamicallyScalable(dynamicScalingEnabled);
|
||||
return _vmDao.update(vmId, vmForUpdate);
|
||||
|
|
|
|||
Loading…
Reference in New Issue