From 3350ab0cf27e01c6b7fc06f7f950340edf95790d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 31 Jan 2009 23:16:55 +0000 Subject: [PATCH] allow calling SetItemLabel() for menu items with NULL menu parent too git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58578 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/menuitem.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp index e31925031e..223ebf3c83 100644 --- a/src/msw/menuitem.cpp +++ b/src/msw/menuitem.cpp @@ -365,6 +365,9 @@ void wxMenuItem::SetItemLabel(const wxString& txt) // the item can be not attached to any menu yet and SetItemLabel() is still // valid to call in this case and should do nothing else + if ( !m_parentMenu ) + return; + const UINT id = GetMSWId(); HMENU hMenu = GetHMenuOf(m_parentMenu); if ( !hMenu || ::GetMenuState(hMenu, id, MF_BYCOMMAND) == (UINT)-1 ) -- 2.45.2