qt wizard bip39 recovery: better handle --offline mode

```
 32.40 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/wspace/electrum/electrum/gui/qt/wizard/wallet.py", line 709, in <lambda>
    button.clicked.connect(lambda: Bip39RecoveryDialog(self, get_account_xpub, on_account_select))
  File "/home/user/wspace/electrum/electrum/gui/qt/bip39_recovery_dialog.py", line 40, in __init__
    fut = asyncio.run_coroutine_threadsafe(coro, network.asyncio_loop)
AttributeError: 'NoneType' object has no attribute 'asyncio_loop'
```
This commit is contained in:
SomberNight
2023-12-01 17:37:58 +00:00
parent 5d178d3a7c
commit 64f82cd260
5 changed files with 26 additions and 7 deletions
+3
View File
@@ -407,6 +407,9 @@ class Network(Logger, NetworkRetryManager[ServerAddr]):
@staticmethod
def get_instance() -> Optional["Network"]:
"""Return the global singleton network instance.
Note that this can return None! If we are run with the --offline flag, there is no network.
"""
return _INSTANCE
def with_recent_servers_lock(func):