Check if selection is not empty before modifying it in EDIT_TOOL

Fixes: lp:1661311
* https://bugs.launchpad.net/kicad/+bug/1661311
This commit is contained in:
Maciej Suminski 2017-02-02 23:31:33 +01:00
parent 340da50315
commit 8dadc18429
1 changed files with 3 additions and 0 deletions

View File

@ -179,6 +179,9 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
if( evt->IsAction( &COMMON_ACTIONS::editActivate )
|| evt->IsMotion() || evt->IsDrag( BUT_LEFT ) )
{
if( selection.Empty() )
break;
BOARD_ITEM* curr_item = selection.Front();
if( m_dragging && evt->Category() == TC_MOUSE )