libedit: Prevent null dereference in popup

Lack of tool manager can happen when the popup is not connected to the
main tool.

Fixes: lp:1829825
* https://bugs.launchpad.net/kicad/+bug/1829825
This commit is contained in:
Seth Hillbrand 2019-05-21 19:58:49 -07:00
parent e1373d70ae
commit 06b22594ca
1 changed files with 3 additions and 1 deletions

View File

@ -321,7 +321,9 @@ void ACTION_MENU::OnMenuEvent( wxMenuEvent& aEvent )
if( type == wxEVT_MENU_OPEN && m_Dirty )
{
getToolManager()->RunAction( ACTIONS::updateMenu, true, this );
if( m_tool )
getToolManager()->RunAction( ACTIONS::updateMenu, true, this );
aEvent.Skip();
return;
}