Symbol editor: fix crash when trying to "drag" an item.

Drag or move is an option of the schematic editor, and not in symbol editor.
So it cannot be tested in code for the symbol editor.
Fixes #15264
https://gitlab.com/kicad/code/kicad/-/issues/15264
This commit is contained in:
jean-pierre charras 2023-07-26 08:58:22 +02:00
parent 812c56bdc7
commit 5ea170baab
1 changed files with 3 additions and 1 deletions

View File

@ -546,7 +546,9 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent )
// Check if dragging has started within any of selected items bounding box
if( selectionContains( evt->DragOrigin() ) )
{
if( m_frame->eeconfig()->m_Input.drag_is_move )
// drag_is_move option exists only in schematic editor, not in symbol editor
// (m_frame->eeconfig() returns nullptr in Symbol Editor)
if( m_isSymbolEditor || m_frame->eeconfig()->m_Input.drag_is_move )
m_toolMgr->RunSynchronousAction( EE_ACTIONS::move, nullptr );
else
m_toolMgr->RunSynchronousAction( EE_ACTIONS::drag, nullptr );