Fixes #5501 null pointer exception in AtlasUI on Windows.
Contrary to wxWidgets documentation, wxMenuEvent::GetMenu() can return NULL when the system menu is accessed on wxMSW, see https://trac.wxwidgets.org/ticket/18443. This was SVN commit r22467.
This commit is contained in:
parent
7300dd186e
commit
80d9a44ab5
@ -997,6 +997,11 @@ void ScenarioEditor::OnHelp(wxCommandEvent& event)
|
||||
void ScenarioEditor::OnMenuOpen(wxMenuEvent& event)
|
||||
{
|
||||
// This could be done far more elegantly if wxMenuItem had changeable id.
|
||||
// Ignore wxMSW system menu events, see https://trac.wildfiregames.com/ticket/5501
|
||||
wxMenu* menu = event.GetMenu();
|
||||
if (!menu)
|
||||
return;
|
||||
|
||||
wxMenu* pasteMenuItem = NULL;
|
||||
event.GetMenu()->FindItem(ID_Paste, &pasteMenuItem);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user