Pcbnew: fix crash due to a not tested null pointer.

Fixes #8369
https://gitlab.com/kicad/code/kicad/issues/8369
This commit is contained in:
jean-pierre charras 2021-05-07 10:35:00 +02:00
parent 063f26531c
commit aaffd0c137
1 changed files with 3 additions and 0 deletions

View File

@ -431,6 +431,9 @@ int PCB_CONTROL::GridSetOrigin( const TOOL_EVENT& aEvent )
std::string tool = aEvent.GetCommandStr().get();
PCB_PICKER_TOOL* picker = m_toolMgr->GetTool<PCB_PICKER_TOOL>();
if( !picker ) // Happens in footprint wizard
return 0;
// Deactivate other tools; particularly important if another PICKER is currently running
Activate();