another comparison fix

This commit is contained in:
Grant Limberg 2020-11-24 14:12:03 -08:00
parent 13d7e2f2b9
commit 86ff1e7cd2
No known key found for this signature in database
GPG Key ID: 2BA62CCABBB4095A
2 changed files with 4 additions and 1 deletions

View File

@ -152,7 +152,9 @@ public final class VirtualNetworkConfig implements Comparable<VirtualNetworkConf
} }
boolean dnsEquals = false; boolean dnsEquals = false;
if (this.dns != null && cfg.dns != null) { if (this.dns == null || cfg.dns == null) {
dnsEquals = true;
} else if (this.dns != null) {
dnsEquals = this.dns.equals(cfg.dns); dnsEquals = this.dns.equals(cfg.dns);
} }

View File

@ -15,6 +15,7 @@ public class VirtualNetworkDNS implements Comparable<VirtualNetworkDNS> {
public VirtualNetworkDNS() {} public VirtualNetworkDNS() {}
public boolean equals(VirtualNetworkDNS o) { public boolean equals(VirtualNetworkDNS o) {
if (o == null) return false;
return domain.equals(o.domain) && servers.equals(o.servers); return domain.equals(o.domain) && servers.equals(o.servers);
} }