You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by da...@apache.org on 2024/06/04 07:28:47 UTC

(cloudstack) branch 4.19 updated: server: fix fail to list public ips of shared networks sometimes (#8624)

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

dahn 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 875cd149195 server: fix fail to list public ips of shared networks sometimes (#8624)
875cd149195 is described below

commit 875cd14919596e0c603c1aaad6e1feedeb419abf
Author: Wei Zhou <we...@apache.org>
AuthorDate: Tue Jun 4 09:28:39 2024 +0200

    server: fix fail to list public ips of shared networks sometimes (#8624)
---
 server/src/main/java/com/cloud/api/ApiResponseHelper.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/server/src/main/java/com/cloud/api/ApiResponseHelper.java b/server/src/main/java/com/cloud/api/ApiResponseHelper.java
index 6d66da43c37..b49a278de5b 100644
--- a/server/src/main/java/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/main/java/com/cloud/api/ApiResponseHelper.java
@@ -992,6 +992,12 @@ public class ApiResponseHelper implements ResponseGenerator {
         if (!isAdmin) {
             return;
         }
+        try {
+            nic.getInstanceId();
+        } catch (NullPointerException ex) {
+            return;
+        }
+
         VirtualMachine vm = ApiDBUtils.findVMInstanceById(nic.getInstanceId());
         if (vm == null) {
             return;