From d2b9c16d5f13104c532f9fd1bb789e3b24f1a1b3 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 3bb36982..7f40bea6 100644 --- a/src/bitmessageqt/__init__.py +++ b/src/bitmessageqt/__init__.py @@ -3977,12 +3977,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 != "":