]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Don't crash (in PreviewJob) when m_shownUrl is empty for some reason.
authorDavid Faure <faure@kde.org>
Wed, 4 Jul 2007 21:25:56 +0000 (21:25 +0000)
committerDavid Faure <faure@kde.org>
Wed, 4 Jul 2007 21:25:56 +0000 (21:25 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=683539

src/infosidebarpage.cpp

index 1bdc677506ee1f7d9b684b6683e29af986456b32..fb422ec892f39e6be38634e0a6464a06d5622cfd 100644 (file)
@@ -160,12 +160,15 @@ void InfoSidebarPage::showItemInfo()
     const KFileItemList& selectedItems = selection();
 
     KUrl file;
-    const int itemCount = selectedItems.count();
-    if (selectedItems.count() == 0) {
+    if (selectedItems.isEmpty()) {
         file = m_shownUrl;
     } else {
         file = selectedItems[0]->url();
     }
+    if (!file.isValid()) {
+        return;
+    }
+    const int itemCount = selectedItems.count();
     if (itemCount > 1) {
         KIconLoader iconLoader;
         QPixmap icon = iconLoader.loadIcon("exec",