Copilot commented on code in PR #12372:
URL: https://github.com/apache/cloudstack/pull/12372#discussion_r2832113487


##########
server/src/main/java/com/cloud/server/ManagementServerImpl.java:
##########
@@ -2580,12 +2581,21 @@ public Pair<List<? extends IpAddress>, Integer> 
searchForIPAddresses(final ListP
         }
 
         if (associatedNetworkId != null) {
-            _accountMgr.checkAccess(caller, null, false, 
networkDao.findById(associatedNetworkId));
-            sc.setParameters("associatedNetworkIdEq", associatedNetworkId);
+            NetworkVO associatedNetwork = 
networkDao.findById(associatedNetworkId);
+
+            if (associatedNetwork != null) {
+                _accountMgr.checkAccess(caller, null, false, 
associatedNetwork);
+                sc.setParameters("associatedNetworkIdEq", associatedNetworkId);
+            }
         }
+

Review Comment:
   Inconsistent blank line placement: there's a blank line after the 
associatedNetworkId block but before the vpcId block. For consistency, remove 
the blank line at 2591 to match the pattern used between other conditional 
blocks in this method.
   ```suggestion
   
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to