Skip to content

Commit 89e6b1f

Browse files
authored
server: fix npe during start vr edge case (#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 02d0dca commit 89e6b1f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,9 @@ public DomainRouterVO startVirtualRouter(final DomainRouterVO router, final User
445445
final int retryIndex = 5;
446446
final ExcludeList[] avoids = new ExcludeList[5];
447447
avoids[0] = new ExcludeList();
448-
avoids[0].addPod(routerToBeAvoid.getPodIdToDeployIn());
448+
if (routerToBeAvoid.getPodIdToDeployIn() != null) {
449+
avoids[0].addPod(routerToBeAvoid.getPodIdToDeployIn());
450+
}
449451
avoids[1] = new ExcludeList();
450452
avoids[1].addCluster(_hostDao.findById(routerToBeAvoid.getHostId()).getClusterId());
451453
avoids[2] = new ExcludeList();

0 commit comments

Comments
 (0)