diff --git a/electrum/gui/qt/address_list.py b/electrum/gui/qt/address_list.py index 4656b2778..0977cf9e7 100644 --- a/electrum/gui/qt/address_list.py +++ b/electrum/gui/qt/address_list.py @@ -187,6 +187,8 @@ class AddressList(MyTreeView): menu = QMenu() if not multi_select: idx = self.indexAt(position) + if not idx.isValid(): + return col = idx.column() item = self.model().itemFromIndex(idx) if not item: diff --git a/electrum/gui/qt/utxo_list.py b/electrum/gui/qt/utxo_list.py index c18d4426f..f549cc9cf 100644 --- a/electrum/gui/qt/utxo_list.py +++ b/electrum/gui/qt/utxo_list.py @@ -124,6 +124,8 @@ class UTXOList(MyTreeView): menu.addAction(_("Details"), lambda: self.parent.show_transaction(tx, label)) # "Copy ..." idx = self.indexAt(position) + if not idx.isValid(): + return col = idx.column() column_title = self.model().horizontalHeaderItem(col).text() copy_text = self.model().itemFromIndex(idx).text() if col != self.Columns.OUTPOINT else selected[0]