fix npe if no localhost connection

This commit is contained in:
woodser 2022-07-14 13:45:50 -04:00
parent 59e5f8e79a
commit f9c5cd1f2c

View file

@ -240,7 +240,7 @@ public final class CoreMoneroConnectionsService {
boolean isLocal = CoreMoneroNodeService.isLocalHost(daemon.getRpcConnection().getUri()); boolean isLocal = CoreMoneroNodeService.isLocalHost(daemon.getRpcConnection().getUri());
if (isLocal) { if (isLocal) {
updateDaemonInfo(); updateDaemonInfo();
if (lastInfo.isBusySyncing() || (lastInfo.getHeightWithoutBootstrap() != null && lastInfo.getHeightWithoutBootstrap() > 0 && lastInfo.getHeightWithoutBootstrap() < lastInfo.getHeight())) return REFRESH_PERIOD_REMOTE_MS; // refresh slower if syncing or bootstrapped if (lastInfo != null && (lastInfo.isBusySyncing() || (lastInfo.getHeightWithoutBootstrap() != null && lastInfo.getHeightWithoutBootstrap() > 0 && lastInfo.getHeightWithoutBootstrap() < lastInfo.getHeight()))) return REFRESH_PERIOD_REMOTE_MS; // refresh slower if syncing or bootstrapped
else return REFRESH_PERIOD_LOCAL_MS; // TODO: announce faster refresh after done syncing else return REFRESH_PERIOD_LOCAL_MS; // TODO: announce faster refresh after done syncing
} else { } else {
return REFRESH_PERIOD_REMOTE_MS; return REFRESH_PERIOD_REMOTE_MS;