Avoid assert when deleting last item from wxListCtrl

See #17959
This commit is contained in:
Paul Cornett
2017-09-24 08:51:48 -07:00
parent 086793ceef
commit 925a1c0734

View File

@@ -4097,6 +4097,7 @@ void wxListMainWindow::DeleteItem( long lindex )
// with many items, the vertical scroll position may change so that the new // 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 // 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. // user point of view. Ensure that whatever happens, this item is visible.
if (count > 1)
EnsureVisible(m_current); EnsureVisible(m_current);
} }