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