From 40f0ff381ec5cb82e9f9de3d3809e1af3b877dcb Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Sat, 13 Feb 2016 00:09:42 +0100 Subject: [PATCH] blacklist rendering edit fix Editing of blacklist labels affected the rerendering, because it emits the changed signal too, and it caused an exception because the address field was missing at that time. This works around both. --- src/bitmessageqt/__init__.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/bitmessageqt/__init__.py b/src/bitmessageqt/__init__.py index fa34890c..d97d4629 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -3976,12 +3976,13 @@ class MyForm(settingsmixin.SMainWindow): def tableWidgetBlacklistItemChanged(self, item): if item.column() == 0: addressitem = self.ui.tableWidgetBlacklist.item(item.row(), 1) - if self.ui.radioButtonBlacklist.isChecked(): - sqlExecute('''UPDATE blacklist SET label=? WHERE address=?''', - str(item.text()), str(addressitem.text())) - else: - sqlExecute('''UPDATE whitelist SET label=? WHERE address=?''', - str(item.text()), str(addressitem.text())) + if isinstance(addressitem, QTableWidgetItem): + if self.ui.radioButtonBlacklist.isChecked(): + sqlExecute('''UPDATE blacklist SET label=? WHERE address=?''', + str(item.text()), str(addressitem.text())) + else: + sqlExecute('''UPDATE whitelist SET label=? WHERE address=?''', + str(item.text()), str(addressitem.text())) def updateStatusBar(self, data): if data != "":