Added test to prevent crash in LogMenuEvent
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9454 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -346,6 +346,8 @@ wxMenuItem *MyFrame::GetLastMenuItem() const
|
|||||||
void MyFrame::LogMenuEvent(const wxCommandEvent& event)
|
void MyFrame::LogMenuEvent(const wxCommandEvent& event)
|
||||||
{
|
{
|
||||||
int id = event.GetId();
|
int id = event.GetId();
|
||||||
|
if (!GetMenuBar()->FindItem(id))
|
||||||
|
return;
|
||||||
wxString msg = wxString::Format("Menu command %d", id);
|
wxString msg = wxString::Format("Menu command %d", id);
|
||||||
if ( GetMenuBar()->FindItem(id)->IsCheckable() )
|
if ( GetMenuBar()->FindItem(id)->IsCheckable() )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user