mirror of https://github.com/apache/cloudstack.git
[Vmware] Prevent NPE on template registration if guest OS is removed (#5980)
This commit is contained in:
parent
212a4dedfc
commit
7f0a322b7d
|
|
@ -176,8 +176,8 @@ public class DeployAsIsHelperImpl implements DeployAsIsHelper {
|
|||
} else {
|
||||
if (StringUtils.isNotEmpty(guestOsDescription)) {
|
||||
for (GuestOSHypervisorVO guestOSHypervisorVO : guestOsMappings) {
|
||||
GuestOSVO guestOSVO = guestOSDao.findById(guestOSHypervisorVO.getGuestOsId());
|
||||
if (guestOsDescription.equalsIgnoreCase(guestOSVO.getDisplayName())) {
|
||||
GuestOSVO guestOSVO = guestOSDao.findByIdIncludingRemoved(guestOSHypervisorVO.getGuestOsId());
|
||||
if (guestOSVO != null && guestOsDescription.equalsIgnoreCase(guestOSVO.getDisplayName())) {
|
||||
guestOsId = guestOSHypervisorVO.getGuestOsId();
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue