Skip to content

Commit bfe5aa7

Browse files
committed
server: fix npe during start vr edge case
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 <[email protected]>
1 parent 802bf5f commit bfe5aa7

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

Lines changed: 3 additions & 1 deletion
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)