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
This commit is contained in:
prachi 2012-05-22 17:42:30 -07:00
parent 686064a8be
commit 83aa7ee125
1 changed files with 5 additions and 3 deletions

View File

@ -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<? extends SecurityRule> ingressRules = _securityGroupService.authorizeSecurityGroupIngress(this);