Fixed the only-type condition for empty selection case.

This commit is contained in:
Maciej Suminski 2014-07-09 16:50:31 +02:00
parent e6c1254dc8
commit 898e4e269e
1 changed files with 3 additions and 0 deletions

View File

@ -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<EDA_ITEM>( i )->Type() != aType )