Fixed a crash when items are unselected when dragging

Fixes: lp:1702355
* https://bugs.launchpad.net/kicad/+bug/1702355
This commit is contained in:
Maciej Suminski 2017-07-19 13:00:48 +02:00
parent 64f00f447f
commit f942e3e31f
1 changed files with 2 additions and 1 deletions

View File

@ -481,7 +481,8 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
break; // exit the loop - we move exactly, so we have finished moving break; // exit the loop - we move exactly, so we have finished moving
} }
if( m_dragging ) // TODO check if the following can be removed
if( m_dragging && !selection.Empty() )
{ {
// Update dragging offset (distance between cursor and the first dragged item) // Update dragging offset (distance between cursor and the first dragged item)
m_offset = static_cast<BOARD_ITEM*>( selection.Front() )->GetPosition() - modPoint; m_offset = static_cast<BOARD_ITEM*>( selection.Front() )->GetPosition() - modPoint;