Eeschema: Check for NULL pointer when using interactive delete tool

CHANGED: If you start the interactive delete tool and the mouse pointer
isn't near anything, Eeschema tries to use a null EDA_ITEM pointer
which throws an exception.  This commit checks if the pointer is null
and exits if it is.
This commit is contained in:
PJM 2020-09-29 19:28:23 -07:00 committed by Ian McInerney
parent e7c31f5dba
commit b0e05ad9bf
1 changed files with 12 additions and 9 deletions

View File

@ -726,6 +726,8 @@ void EE_SELECTION_TOOL::GuessSelectionCandidates( EE_COLLECTOR& collector, const
}
}
if( closest ) // Don't try and get a tight bbox if nothing is near the mouse pointer
{
EDA_RECT tightBox = closest->GetBoundingBox();
tightBox.Inflate( -tightBox.GetWidth() / 4, -tightBox.GetHeight() / 4 );
@ -740,6 +742,7 @@ void EE_SELECTION_TOOL::GuessSelectionCandidates( EE_COLLECTOR& collector, const
collector.Transfer( item );
}
}
}
EE_SELECTION& EE_SELECTION_TOOL::RequestSelection( const KICAD_T aFilterList[] )