From 8dadc184294952ba57c42ae7f436fcbb843288ac Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 2 Feb 2017 23:31:33 +0100 Subject: [PATCH] Check if selection is not empty before modifying it in EDIT_TOOL Fixes: lp:1661311 * https://bugs.launchpad.net/kicad/+bug/1661311 --- pcbnew/tools/edit_tool.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 651ea5bab7..a344b31106 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -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 )