added check for null

This commit is contained in:
Abhinandan Prateek 2011-06-14 10:31:03 +05:30
parent 5b19a5e731
commit 6c35a97cd8
2 changed files with 2 additions and 2 deletions

View File

@ -139,7 +139,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

@ -1224,7 +1224,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());