X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d00b880a793b5041add99065021f75d4fb788f50..68c124a1685a951ff9375d23fcc9ba5a6befc31f:/src/univ/listbox.cpp diff --git a/src/univ/listbox.cpp b/src/univ/listbox.cpp index 9a519bcc22..7ae71b51fe 100644 --- a/src/univ/listbox.cpp +++ b/src/univ/listbox.cpp @@ -274,7 +274,8 @@ void wxListBox::Clear() void wxListBox::Delete(int n) { - wxCHECK_RET( n < GetCount(), _T("invalid index in wxListBox::Delete") ); + wxCHECK_RET( n >= 0 && n < GetCount(), + _T("invalid index in wxListBox::Delete") ); // do it before removing the index as otherwise the last item will not be // refreshed (as GetCount() will be decremented)