From 854b0acd1a259fab40e42c8470bb144c955dcc5a Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 4 Dec 2011 18:16:39 +0100 Subject: Fix crash #1 when filtering items When filtering items it was possible that the current index got an invalid value which resulted in accessing the URL of a null-KFileItem. There is still one (general) open issue in KFileItemModelRolesUpdater (crash #2) where a KFileItem that is already null gets read. It is not really related to filtering but can be triggered quite easy when filtering huge directories with enabled previews. CCBUG: 287642 --- src/views/dolphinview.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/views/dolphinview.cpp') diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 857aae395..455905f6a 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -950,6 +950,7 @@ void DolphinView::saveState(QDataStream& stream) const int currentIndex = m_container->controller()->selectionManager()->currentItem(); if (currentIndex != -1) { KFileItem item = fileItemModel()->fileItem(currentIndex); + Q_ASSERT(!item.isNull()); // If the current index is valid a item must exist KUrl currentItemUrl = item.url(); stream << currentItemUrl; } else { -- cgit v1.3