mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
[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 {
|
} else {
|
||||||
if (StringUtils.isNotEmpty(guestOsDescription)) {
|
if (StringUtils.isNotEmpty(guestOsDescription)) {
|
||||||
for (GuestOSHypervisorVO guestOSHypervisorVO : guestOsMappings) {
|
for (GuestOSHypervisorVO guestOSHypervisorVO : guestOsMappings) {
|
||||||
GuestOSVO guestOSVO = guestOSDao.findById(guestOSHypervisorVO.getGuestOsId());
|
GuestOSVO guestOSVO = guestOSDao.findByIdIncludingRemoved(guestOSHypervisorVO.getGuestOsId());
|
||||||
if (guestOsDescription.equalsIgnoreCase(guestOSVO.getDisplayName())) {
|
if (guestOSVO != null && guestOsDescription.equalsIgnoreCase(guestOSVO.getDisplayName())) {
|
||||||
guestOsId = guestOSHypervisorVO.getGuestOsId();
|
guestOsId = guestOSHypervisorVO.getGuestOsId();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user