Fix asserts in TitleManager and DownloadManager (#134)

This commit is contained in:
bitscher
2022-09-01 18:24:07 +02:00
committed by GitHub
parent d8da8a54a6
commit b8d4cf5b29
2 changed files with 14 additions and 2 deletions
+7 -1
View File
@@ -629,7 +629,13 @@ void wxDownloadManagerList::SortEntries()
RefreshPage();
}
void wxDownloadManagerList::RefreshPage() { RefreshItems(GetTopItem(), GetTopItem() + GetCountPerPage() + 1); }
void wxDownloadManagerList::RefreshPage()
{
long item_count = GetItemCount();
if (item_count > 0)
RefreshItems(GetTopItem(), std::min(item_count - 1, GetTopItem() + GetCountPerPage() + 1));
}
int wxDownloadManagerList::Filter(const wxString& filter, const wxString& prefix, ItemColumn column)
{
+7 -1
View File
@@ -1170,7 +1170,13 @@ void wxTitleManagerList::SortEntries(int column)
RefreshPage();
}
void wxTitleManagerList::RefreshPage() { RefreshItems(GetTopItem(), GetTopItem() + GetCountPerPage() + 1); }
void wxTitleManagerList::RefreshPage()
{
long item_count = GetItemCount();
if (item_count > 0)
RefreshItems(GetTopItem(), std::min(item_count - 1, GetTopItem() + GetCountPerPage() + 1));
}
int wxTitleManagerList::Filter(const wxString& filter, const wxString& prefix, ItemColumn column)
{