diff options
| author | Frank Reininghaus <[email protected]> | 2011-11-22 00:52:28 +0100 |
|---|---|---|
| committer | Frank Reininghaus <[email protected]> | 2011-11-22 00:54:52 +0100 |
| commit | 1f41bed142bac68508f4f90e2d9e43da8ce871da (patch) | |
| tree | 95ff0ef1ce30fc4fd5281d34df63c115945c7f7d /src/kitemviews | |
| parent | 36b8989179a537ef7801e1f77d0ef7d35b470cf3 (diff) | |
Don't try to divide by zero.
Fixes a crash in Dolphin when pressing a key so quickly after a url
change that there are no items in the file item model yet.
BUG:287147
Diffstat (limited to 'src/kitemviews')
| -rw-r--r-- | src/kitemviews/kitemlistcontroller.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 5d4963bfd..b24e6df14 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -240,7 +240,7 @@ bool KItemListController::keyPressEvent(QKeyEvent* event) void KItemListController::slotChangeCurrentItem(const QString& text, bool searchFromNextItem) { - if (!m_model) { + if (!m_model || m_model->count() == 0) { return; } const int currentIndex = m_selectionManager->currentItem(); |
