fix fallback prompt with null daemon connection

This commit is contained in:
woodser 2025-01-14 09:10:12 -05:00
parent 0f5f7ae46e
commit 5e6bf9e22b

View file

@ -725,8 +725,8 @@ public final class XmrConnectionService {
// poll daemon // poll daemon
if (daemon == null) switchToBestConnection(); if (daemon == null) switchToBestConnection();
if (daemon == null) throw new RuntimeException("No connection to Monero daemon");
try { try {
if (daemon == null) throw new RuntimeException("No connection to Monero daemon");
lastInfo = daemon.getInfo(); lastInfo = daemon.getInfo();
} catch (Exception e) { } catch (Exception e) {
@ -753,6 +753,7 @@ public final class XmrConnectionService {
// switch to best connection // switch to best connection
switchToBestConnection(); switchToBestConnection();
if (daemon == null) throw new RuntimeException("No connection to Monero daemon after error handling");
lastInfo = daemon.getInfo(); // caught internally if still fails lastInfo = daemon.getInfo(); // caught internally if still fails
} }