mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
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
1 changed files with 5 additions and 0 deletions
|
|
@ -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 a new issue