]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/kitemviews/kfileitemmodel.cpp
Fix possible crash in KFileItemModel::slotRefreshItems()
[dolphin.git] / src / kitemviews / kfileitemmodel.cpp
index c0287340ee7039c2fb67c4cf35bcfb764f5cc7c7..ca15837529282f60dcb7728d0950b671ba6468b4 100644 (file)
@@ -438,6 +438,12 @@ void KFileItemModel::slotRefreshItems(const QList<QPair<KFileItem, KFileItem> >&
         }
     }
 
+    // If the changed items have been created recently, they might not be in m_items yet.
+    // In that case, the list 'indexes' might be empty.
+    if (indexes.isEmpty()) {
+        return;
+    }
+
     // Extract the item-ranges out of the changed indexes
     qSort(indexes);