aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-10-24 21:46:15 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-10-24 21:46:15 +0000
commit530f05904f57d99bcb9932f49fcee46786bb2de2 (patch)
tree63d0f960470a472b79b7a9d226a75248f2c13d3f
parentdont show icons in menu (diff)
downloadgpg4usb-530f05904f57d99bcb9932f49fcee46786bb2de2.tar.gz
gpg4usb-530f05904f57d99bcb9932f49fcee46786bb2de2.zip
fix crash if save in attachment-table is empty
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@572 34ebc366-c3a9-4b3c-9f84-69acf7962910
-rw-r--r--attachments.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/attachments.cpp b/attachments.cpp
index dbb2fca..abe1b71 100644
--- a/attachments.cpp
+++ b/attachments.cpp
@@ -95,6 +95,10 @@ void Attachments::saveFile()
QModelIndexList indexes = tableView->selectionModel()->selection().indexes();
+ if (indexes.size() < 1) {
+ return;
+ }
+
// only singe-selection possible now: TODO: foreach
MimePart mp = table->getMimePart(indexes.at(0).row());
QString filename = mp.header.getParam("Content-Type", "name");