]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Don't try to divide by zero.
authorFrank Reininghaus <frank78ac@googlemail.com>
Mon, 21 Nov 2011 23:52:28 +0000 (00:52 +0100)
committerFrank Reininghaus <frank78ac@googlemail.com>
Mon, 21 Nov 2011 23:54:52 +0000 (00:54 +0100)
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

src/kitemviews/kitemlistcontroller.cpp

index 5d4963bfd21c30eb471d0c7de0b22a300a87b4bd..b24e6df1410d2de61baef49b2cb0a76d060f838c 100644 (file)
@@ -240,7 +240,7 @@ bool KItemListController::keyPressEvent(QKeyEvent* event)
 
 void KItemListController::slotChangeCurrentItem(const QString& text, bool searchFromNextItem)
 {
 
 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();
         return;
     }
     const int currentIndex = m_selectionManager->currentItem();