]> cloud.milkyroute.net Git - dolphin.git/commitdiff
dolphinview: fix crash
authorMéven Car <meven@kde.org>
Thu, 1 May 2025 08:42:48 +0000 (10:42 +0200)
committerMéven Car <meven@kde.org>
Fri, 2 May 2025 07:28:48 +0000 (09:28 +0200)
Correctly find the last element in the list instead of the one after the last

Amends: 0464ea82a6850f58805bc4d6fc1df5369d83c3df

BUG: 503610

src/views/dolphinview.cpp

index 0afa27d738220f179bd6eb6bbec5da58d5fe0d35..933bfda07fd1ec7c5907ad414c932b7b587ec5e8 100644 (file)
@@ -1883,7 +1883,7 @@ void DolphinView::selectNextItem()
             Q_ASSERT_X(false, "DolphinView", "Selecting the next item failed.");
             return;
         }
-        const auto lastSelectedIndex = m_model->index(*selectedItems().constEnd());
+        const auto lastSelectedIndex = m_model->index(selectedItems().constLast());
         if (lastSelectedIndex < 0) {
             Q_ASSERT_X(false, "DolphinView", "Selecting the next item failed.");
             return;