Skip to content

Commit c7e554f

Browse files
shwstpprdhslove
authored andcommitted
server: fix npe during start vr edge case (apache#10366)
DeploymentPlanner.addPod takes long value while VmInstanceVO.getPodIdToDeployIn returns a Long value which can be null when the VM is never started. Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 180a0a8 commit c7e554f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

server/src/main/java/com/cloud/network/router/NetworkHelperImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,9 @@ public DomainRouterVO startVirtualRouter(final DomainRouterVO router, final User
446446
final int retryIndex = 5;
447447
final ExcludeList[] avoids = new ExcludeList[5];
448448
avoids[0] = new ExcludeList();
449-
avoids[0].addPod(routerToBeAvoid.getPodIdToDeployIn());
449+
if (routerToBeAvoid.getPodIdToDeployIn() != null) {
450+
avoids[0].addPod(routerToBeAvoid.getPodIdToDeployIn());
451+
}
450452
avoids[1] = new ExcludeList();
451453
avoids[1].addCluster(_hostDao.findById(routerToBeAvoid.getHostId()).getClusterId());
452454
avoids[2] = new ExcludeList();

0 commit comments

Comments
 (0)