From 0ee573f7d20a6d4be35757573d73c1f7aed6e121 Mon Sep 17 00:00:00 2001 From: Montel Laurent Date: Fri, 1 Jun 2012 13:14:48 +0200 Subject: Fix crash when item is not selected (for example list is empty) --- src/settings/passexceptionswidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/settings/passexceptionswidget.cpp b/src/settings/passexceptionswidget.cpp index feee4d88..bf705723 100644 --- a/src/settings/passexceptionswidget.cpp +++ b/src/settings/passexceptionswidget.cpp @@ -53,7 +53,10 @@ PassExWidget::PassExWidget(QWidget *parent) void PassExWidget::removeOne() { - QString item = listWidget->takeItem(listWidget->currentRow())->text(); + const int currentRow(listWidget->currentRow()); + if(currentRow==-1) + return; + QString item = listWidget->takeItem(currentRow)->text(); QStringList exList = ReKonfig::walletBlackList(); exList.removeOne(item); -- cgit v1.2.1