Don't try and select if we don't have a location.
Fixes https://gitlab.com/kicad/code/kicad/issues/5088
This commit is contained in:
parent
6a4f611e61
commit
4b51184678
|
@ -58,11 +58,17 @@ bool GLOBAL_EDIT_TOOL::Init()
|
|||
|
||||
int GLOBAL_EDIT_TOOL::ExchangeFootprints( const TOOL_EVENT& aEvent )
|
||||
{
|
||||
PCBNEW_SELECTION& selection = m_selectionTool->RequestSelection( EDIT_TOOL::FootprintFilter );
|
||||
MODULE* mod = (selection.Empty() ? nullptr : selection.FirstOfKind<MODULE> () );
|
||||
PCBNEW_SELECTION& selection = m_selectionTool->GetSelection();
|
||||
MODULE* mod = nullptr;
|
||||
bool updateMode = false;
|
||||
bool currentMode = false;
|
||||
|
||||
if( aEvent.HasPosition() )
|
||||
selection = m_selectionTool->RequestSelection( EDIT_TOOL::FootprintFilter );
|
||||
|
||||
if( !selection.Empty() )
|
||||
mod = selection.FirstOfKind<MODULE>();
|
||||
|
||||
if( aEvent.IsAction( &PCB_ACTIONS::updateFootprint ) )
|
||||
{
|
||||
updateMode = true;
|
||||
|
|
Loading…
Reference in New Issue