From: Méven Car Date: Thu, 1 May 2025 08:42:48 +0000 (+0200) Subject: dolphinview: fix crash X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/f9569eb19d3dad9693312015436a5419322a3a1b dolphinview: fix crash Correctly find the last element in the list instead of the one after the last Amends: 0464ea82a6850f58805bc4d6fc1df5369d83c3df BUG: 503610 --- diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 0afa27d73..933bfda07 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -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;