qml: QERequestDetails: handle _wallet = None in callback
What changed, and why it matters
This is a small bug-fix patch for Electrum's mobile-style QML user interface. It prevents a crash when a payment-request status update arrives after the wallet object has already been cleared. The change simply checks that the wallet reference still exists before comparing it. There is no direct evidence in the commit that this is a security vulnerability, and the most likely effect is a harmless UI crash rather than a security exploit.
Treat as a routine stability fix. Review issue #10617 if available to confirm whether the crash is reproducible and whether any data-loss side effects exist. No urgent security response is indicated by the diff alone.
Security signals we found
Null-pointer / None-reference dereference in event callback
Crash-only UI path in QML payment request status handler
No authentication, privilege, or cryptographic boundary crossed
No untrusted input parsed or executed
Evidence from the diff
In electrum/gui/qml/qerequestdetails.py, the on_event_request_status callback previously compared wallet == self._wallet.wallet without first verifying that self._wallet was not None. If self._wallet had been set to None (for example, during component teardown or wallet switch), the comparison would raise AttributeError and likely crash the QML event handler. The patch adds a short-circuit guard: if self._wallet and wallet == self._wallet.wallet and key == self._key. This is a defensive null-pointer fix. The referenced issue #10617 is not supplied, so its exact severity is unknown from the materials.
Changed components
electrum/gui/qml/qerequestdetails.pyQML GUI payment request details viewon_event_request_status event listenerInspect captured patch +1 / −1
diff --git a/electrum/gui/qml/qerequestdetails.py b/electrum/gui/qml/qerequestdetails.py
index f0f2155..6a5b767 100644
--- a/electrum/gui/qml/qerequestdetails.py
+++ b/electrum/gui/qml/qerequestdetails.py
@@ -69,7 +69,7 @@ class QERequestDetails(QObject, QtEventListener):
@qt_event_listener
def on_event_request_status(self, wallet, key, status):
- if wallet == self._wallet.wallet and key == self._key:
+ if self._wallet and wallet == self._wallet.wallet and key == self._key:
self._logger.debug('request status %d for key %s' % (status, key))
self.statusChanged.emit()
Why this scored 22/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.