From 898e4e269e2bd3e37988673e7bec67f428179da6 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 9 Jul 2014 16:50:31 +0200 Subject: [PATCH] Fixed the only-type condition for empty selection case. --- pcbnew/tools/selection_conditions.cpp | 3 +++ 1 file changed, 3 insertions(+) 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 )