Skip to content

qt: SettingsDialog: guard self.network access#10556

Merged
ecdsa merged 1 commit intospesmilo:masterfrom
f321x:settings_dialog_guard_network
Mar 27, 2026
Merged

qt: SettingsDialog: guard self.network access#10556
ecdsa merged 1 commit intospesmilo:masterfrom
f321x:settings_dialog_guard_network

Conversation

@f321x
Copy link
Copy Markdown
Member

@f321x f321x commented Mar 27, 2026

Check if self.network before trying to access it. This would trigger an exception when toggling the trampoline checkbox in offline mode:

 29.13 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/Documents/electrum/electrum/gui/qt/settings_dialog.py", line 133, in on_trampoline_checked
    self.network.run_from_another_thread(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'run_from_another_thread'
 31.00 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/Documents/electrum/electrum/gui/qt/settings_dialog.py", line 131, in on_trampoline_checked
    self.network.start_gossip()
    ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'start_gossip'

Check if self.network before trying to access it. This would trigger an
exception when toggling the trampoline checkbox in offline mode:
```
 29.13 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/Documents/electrum/electrum/gui/qt/settings_dialog.py", line 133, in on_trampoline_checked
    self.network.run_from_another_thread(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'run_from_another_thread'
 31.00 | E | gui.qt.exception_window.Exception_Hook | exception caught by crash reporter
Traceback (most recent call last):
  File "/home/user/Documents/electrum/electrum/gui/qt/settings_dialog.py", line 131, in on_trampoline_checked
    self.network.start_gossip()
    ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'start_gossip'
```
@ecdsa ecdsa merged commit efbe190 into spesmilo:master Mar 27, 2026
12 of 16 checks passed
@SomberNight SomberNight added this to the 4.7.2 milestone Apr 1, 2026
SomberNight pushed a commit to SomberNight/electrum that referenced this pull request Apr 1, 2026
…twork

qt: SettingsDialog: guard self.network access
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants