From 63c95fafeaa0276f22c7c429e3aa78ba43f52dab Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 12 Nov 2006 22:33:21 +0000 Subject: [PATCH] don't assert if 'c' key is pressed when there is no selection git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43379 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/listctrl/listtest.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index 24f1a18861..17d18c235b 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -915,6 +915,12 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event) { wxListItem info; info.m_itemId = event.GetIndex(); + if ( info.m_itemId == -1 ) + { + // no item + break; + } + GetItem(info); wxListItemAttr *attr = info.GetAttributes(); -- 2.45.2