File r900503.diff of Package kdepim4
Subject: korganizer: avoid assert when adding attachments
From: wstephenson@suse.de
Bug:
Patch-upstream: 900503
--- korganizer/koeditorattachments.cpp (revision 900502)
+++ korganizer/koeditorattachments.cpp (revision 900503)
@@ -321,8 +321,11 @@ class AttachmentIconView : public K3Icon
}
KTemporaryFile *file = new KTemporaryFile();
file->setParent( this );
- file->setSuffix(
- QString( KMimeType::mimeType( attachment->mimeType() )->patterns().first() ).remove( '*' ) );
+
+ QStringList patterns = KMimeType::mimeType( attachment->mimeType() )->patterns();
+ if ( !patterns.empty() ) {
+ file->setSuffix( QString( patterns.first() ).remove( '*' ) );
+ }
file->setAutoRemove( true );
file->open();
// read-only not to give the idea that it could be written to
Index: korganizer/koeditorattachments.cpp
===================================================================