From: David Faure Date: Wed, 4 Jul 2007 21:25:56 +0000 (+0000) Subject: Don't crash (in PreviewJob) when m_shownUrl is empty for some reason. X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/089f4745130f1d19e6720539feb8ac99d1043bda Don't crash (in PreviewJob) when m_shownUrl is empty for some reason. svn path=/trunk/KDE/kdebase/apps/; revision=683539 --- diff --git a/src/infosidebarpage.cpp b/src/infosidebarpage.cpp index 1bdc67750..fb422ec89 100644 --- a/src/infosidebarpage.cpp +++ b/src/infosidebarpage.cpp @@ -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",