This is an automated email from the ASF dual-hosted git repository.

rohit pushed a commit to branch 4.19
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


The following commit(s) were added to refs/heads/4.19 by this push:
     new 89e6b1f8ea0 server: fix npe during start vr edge case (#10366)
89e6b1f8ea0 is described below

commit 89e6b1f8ea00cc38aa384fd6383a614daf1663b6
Author: Abhishek Kumar <abhishek.mr...@gmail.com>
AuthorDate: Tue Mar 18 08:52:11 2025 +0530

    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.mr...@gmail.com>
---
 server/src/main/java/com/cloud/network/router/NetworkHelperImpl.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/server/src/main/java/com/cloud/network/router/NetworkHelperImpl.java 
b/server/src/main/java/com/cloud/network/router/NetworkHelperImpl.java
index 38286b5d4d9..4a1c5b64d21 100644
--- a/server/src/main/java/com/cloud/network/router/NetworkHelperImpl.java
+++ b/server/src/main/java/com/cloud/network/router/NetworkHelperImpl.java
@@ -445,7 +445,9 @@ public class NetworkHelperImpl implements NetworkHelper {
         final int retryIndex = 5;
         final ExcludeList[] avoids = new ExcludeList[5];
         avoids[0] = new ExcludeList();
-        avoids[0].addPod(routerToBeAvoid.getPodIdToDeployIn());
+        if (routerToBeAvoid.getPodIdToDeployIn() != null) {
+            avoids[0].addPod(routerToBeAvoid.getPodIdToDeployIn());
+        }
         avoids[1] = new ExcludeList();
         
avoids[1].addCluster(_hostDao.findById(routerToBeAvoid.getHostId()).getClusterId());
         avoids[2] = new ExcludeList();

Reply via email to