fix npe with xmrNodes with onion address
This commit is contained in:
parent
68f7067125
commit
c9350e123e
1 changed files with 6 additions and 3 deletions
|
@ -112,8 +112,7 @@ public class XmrLocalNode {
|
||||||
// determine if local node is configured
|
// determine if local node is configured
|
||||||
boolean hasConfiguredLocalNode = false;
|
boolean hasConfiguredLocalNode = false;
|
||||||
for (XmrNode node : xmrNodes.selectPreferredNodes(new XmrNodesSetupPreferences(preferences))) {
|
for (XmrNode node : xmrNodes.selectPreferredNodes(new XmrNodesSetupPreferences(preferences))) {
|
||||||
String prefix = node.getAddress().startsWith("http") ? "" : "http://";
|
if (node.getAddress() != null && equalsUri("http://" + node.getAddress() + ":" + node.getPort())) {
|
||||||
if (equalsUri(prefix + node.getAddress() + ":" + node.getPort())) {
|
|
||||||
hasConfiguredLocalNode = true;
|
hasConfiguredLocalNode = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -139,7 +138,11 @@ public class XmrLocalNode {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean equalsUri(String uri) {
|
public boolean equalsUri(String uri) {
|
||||||
|
try {
|
||||||
return HavenoUtils.isLocalHost(uri) && MoneroUtils.parseUri(uri).getPort() == HavenoUtils.getDefaultMoneroPort();
|
return HavenoUtils.isLocalHost(uri) && MoneroUtils.parseUri(uri).getPort() == HavenoUtils.getDefaultMoneroPort();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue