You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/12/06 14:51:35 UTC

[GitHub] [cloudstack] GutoVeronezi commented on a change in pull request #5723: server: Fix NPE while adding network to VPC

GutoVeronezi commented on a change in pull request #5723:
URL: https://github.com/apache/cloudstack/pull/5723#discussion_r763077683



##########
File path: server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java
##########
@@ -348,7 +348,7 @@ public Provider getProvider() {
 
         //1st time it runs the domain router of the VM shall be returned
         List<DomainRouterVO> routers = super.getRouters(network, dest);
-        if (routers.size() > 0) {
+        if (routers != null && routers.size() > 0) {

Review comment:
       We could use `org.apache.commons.collections.CollectionUtils#isNotEmpty` here.




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org