avoid NPE on hello message with missing "yourip" key

http://mantis.tokeek.de/view.php?id=684
pull/77/head
reger 8 years ago
parent e51ab8c7aa
commit e990297d2e

@ -259,6 +259,10 @@ public final class Protocol {
mySeed.setIPs(Switchboard.getSwitchboard().myPublicIPs());
} else {
final String myIP = result.get("yourip");
if (myIP == null) {
Network.log.info("yacyClient.hello result error: Peer sent incompleet hello message (key yourip is missing)");
return null; // no success
}
// with the IPv6 extension, this may contain several ips, separated by comma ','
HashSet<String> h = new HashSet<>();
for (String s: CommonPattern.COMMA.split(myIP)) {

Loading…
Cancel
Save