diff options
| author | Peter Penz <[email protected]> | 2011-12-04 18:16:39 +0100 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2011-12-04 18:21:46 +0100 |
| commit | 854b0acd1a259fab40e42c8470bb144c955dcc5a (patch) | |
| tree | 376e1aa31a85dd410ba1d4236cb0b3c26c83763a /src/views/dolphinview.cpp | |
| parent | 031b1a4c19945456a389ddb00630aadf95b0c09a (diff) | |
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
Diffstat (limited to 'src/views/dolphinview.cpp')
| -rw-r--r-- | src/views/dolphinview.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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 { |
