added missing check for null

This commit is contained in:
Abhinandan Prateek 2011-06-14 10:24:49 +05:30
parent b1ced0e478
commit 11816a174d
2 changed files with 2 additions and 2 deletions

View File

@ -144,7 +144,7 @@ public class VirtualRoutingResource implements Manager {
command.add("-p ", rule.getStringSrcPortRange());
command.add("-r ", rule.getDstIp());
command.add("-d ", rule.getStringDstPortRange());
if (rule.getSourceCidrs().size() > 0){
if (rule.getSourceCidrs() != null && rule.getSourceCidrs().size() > 0){
command.add(" -s " + rule.getStringSourceCidrs());
}
result = command.execute();

View File

@ -1220,7 +1220,7 @@ public abstract class CitrixResourceBase implements ServerResource, HypervisorRe
args.append(" -p ").append(rule.getStringSrcPortRange());
args.append(" -r ").append(rule.getDstIp());
args.append(" -d ").append(rule.getStringDstPortRange());
if (rule.getSourceCidrs().size() > 0){
if (rule.getSourceCidrs() != null && rule.getSourceCidrs().size() > 0){
args.append(" -s " + rule.getStringSourceCidrs());
}
String result = callHostPlugin(conn, "vmops", "setFirewallRule", "args", args.toString());