mirror of https://github.com/apache/cloudstack.git
added check for null
This commit is contained in:
parent
5b19a5e731
commit
6c35a97cd8
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
Loading…
Reference in New Issue