From 1c852328c0f76ce218e18e6cc94092ea6443fec8 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Fri, 12 Aug 2022 11:58:20 +0200 Subject: [PATCH] qml: try-except around data query, history is very unpredictable what's present and what's not --- electrum/gui/qml/qetransactionlistmodel.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/electrum/gui/qml/qetransactionlistmodel.py b/electrum/gui/qml/qetransactionlistmodel.py index 934a5ce31..fdc9719e1 100644 --- a/electrum/gui/qml/qetransactionlistmodel.py +++ b/electrum/gui/qml/qetransactionlistmodel.py @@ -35,7 +35,13 @@ class QETransactionListModel(QAbstractListModel): def data(self, index, role): tx = self.tx_history[index.row()] role_index = role - Qt.UserRole - value = tx[self._ROLE_NAMES[role_index]] + + try: + value = tx[self._ROLE_NAMES[role_index]] + except KeyError as e: + self._logger.error(f'non-existing key "{self._ROLE_NAMES[role_index]}" requested') + value = None + if isinstance(value, (bool, list, int, str, QEAmount)) or value is None: return value if isinstance(value, Satoshis):