From 79d35109f042c36dbfe389dc4454f9f4b619f8c3 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 7 Nov 2017 02:41:24 +0100 Subject: [PATCH] Avoid assert if there is no selection in wxListCtrl::DeleteItem() Don't try making the current item visible if there is no current item. This is another fix after 99d7b13e3f221ed622143b5420afca244bf0007d (in addition to the previous 925a1c0734eef56ec6a9c5d5f89f6c4285768f0a). --- src/generic/listctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 6f90877e3d..1ea2442ffa 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -4097,7 +4097,7 @@ void wxListMainWindow::DeleteItem( long lindex ) // with many items, the vertical scroll position may change so that the new // last item is not visible any longer, which is very annoying from the // user point of view. Ensure that whatever happens, this item is visible. - if (count > 1) + if ( count > 1 && m_current != (size_t)-1 ) EnsureVisible(m_current); }