forked from Qortal/qortal
Check for null IP address before notifying of an external IP update.
This commit is contained in:
parent
c6405340bc
commit
76df332b57
@ -1164,11 +1164,13 @@ public class Network {
|
|||||||
if (consecutiveReadings >= consecutiveReadingsRequired) {
|
if (consecutiveReadings >= consecutiveReadingsRequired) {
|
||||||
// Last 10 readings were the same - i.e. more than one peer agreed on the new IP address...
|
// Last 10 readings were the same - i.e. more than one peer agreed on the new IP address...
|
||||||
String ip = ipAddressHistory.get(size - 1);
|
String ip = ipAddressHistory.get(size - 1);
|
||||||
if (!Objects.equals(ip, this.ourExternalIpAddress)) {
|
if (ip != null && !Objects.equals(ip, "null")) {
|
||||||
// ... and the readings were different to our current recorded value, so
|
if (!Objects.equals(ip, this.ourExternalIpAddress)) {
|
||||||
// update our external IP address value
|
// ... and the readings were different to our current recorded value, so
|
||||||
this.ourExternalIpAddress = ip;
|
// update our external IP address value
|
||||||
this.onExternalIpUpdate(ip);
|
this.ourExternalIpAddress = ip;
|
||||||
|
this.onExternalIpUpdate(ip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user