Check the focus iterator before dereferencing it on erase.

Erasing a download read past the end of the view.
This commit is contained in:
xirvik
2026-08-10 02:41:08 +00:00
committed by Jari Sundell
parent a075001a73
commit 946a4b5c83
+1 -1
View File
@@ -89,7 +89,7 @@ DownloadList::unfocus_download(core::Download* d) {
if (m_state == DISPLAY_DOWNLOAD && d == static_cast<Download*>(m_uiArray[DISPLAY_DOWNLOAD])->download())
activate_display(DISPLAY_DOWNLOAD_LIST);
if (*current_view()->focus() == d && current_view()->focus() < current_view()->end_visible())
if (current_view()->focus() < current_view()->end_visible() && *current_view()->focus() == d)
current_view()->next_focus();
}