X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d00b880a793b5041add99065021f75d4fb788f50..643a0828dac932568e143b16b63a1cac0cd7d588:/src/univ/listbox.cpp?ds=sidebyside

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)