diff --git a/pcbnew/tools/selection_conditions.cpp b/pcbnew/tools/selection_conditions.cpp index f1679dac8b..fe130b9db4 100644 --- a/pcbnew/tools/selection_conditions.cpp +++ b/pcbnew/tools/selection_conditions.cpp @@ -78,6 +78,9 @@ bool SELECTION_CONDITIONS::hasTypeFunc( const SELECTION& aSelection, KICAD_T aTy bool SELECTION_CONDITIONS::onlyTypeFunc( const SELECTION& aSelection, KICAD_T aType ) { + if( aSelection.Empty() ) + return false; + for( int i = 0; i < aSelection.Size(); ++i ) { if( aSelection.Item( i )->Type() != aType )