From 83aa7ee125a053b78454dd9f752ee6554cf50c67 Mon Sep 17 00:00:00 2001 From: prachi Date: Tue, 22 May 2012 17:42:30 -0700 Subject: [PATCH] CS-15061: Not able to add account based ingress rules.NullPointerException seen in management server logs. Reviewed-By: Sheng Yang Adding null check - regression due to CS 14968 --- .../api/commands/AuthorizeSecurityGroupIngressCmd.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api/src/com/cloud/api/commands/AuthorizeSecurityGroupIngressCmd.java b/api/src/com/cloud/api/commands/AuthorizeSecurityGroupIngressCmd.java index 1c505c7f6da..33fc240d17c 100644 --- a/api/src/com/cloud/api/commands/AuthorizeSecurityGroupIngressCmd.java +++ b/api/src/com/cloud/api/commands/AuthorizeSecurityGroupIngressCmd.java @@ -205,9 +205,11 @@ public class AuthorizeSecurityGroupIngressCmd extends BaseAsyncCmd { @Override public void execute() { - for(String cidr : cidrList ){ - if (!NetUtils.isValidCIDR(cidr)){ - throw new ServerApiException(BaseCmd.PARAM_ERROR, cidr + " is an Invalid CIDR "); + if(cidrList != null){ + for(String cidr : cidrList ){ + if (!NetUtils.isValidCIDR(cidr)){ + throw new ServerApiException(BaseCmd.PARAM_ERROR, cidr + " is an Invalid CIDR "); + } } } List ingressRules = _securityGroupService.authorizeSecurityGroupIngress(this);