From b4ac59d9d3683d52e030beb8707cc32e8557ea38 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 21 Feb 2022 12:25:22 +0000 Subject: [PATCH] Don't crash on highight net during drag. Fixes https://gitlab.com/kicad/code/kicad/issues/10866 --- eeschema/sch_item.cpp | 2 +- eeschema/tools/sch_line_wire_bus_tool.cpp | 3 +++ eeschema/tools/sch_move_tool.cpp | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_item.cpp b/eeschema/sch_item.cpp index 10adc87a2a..71f797c9af 100644 --- a/eeschema/sch_item.cpp +++ b/eeschema/sch_item.cpp @@ -140,7 +140,7 @@ SCH_CONNECTION* SCH_ITEM::Connection( const SCH_SHEET_PATH* aSheet ) const if( !IsConnectable() ) return nullptr; - wxASSERT_MSG( !IsConnectivityDirty(), + wxCHECK_MSG( !IsConnectivityDirty(), nullptr, wxT( "Shouldn't be asking for connection if connectivity is dirty!" ) ); if( !aSheet ) diff --git a/eeschema/tools/sch_line_wire_bus_tool.cpp b/eeschema/tools/sch_line_wire_bus_tool.cpp index bed69d7971..c228aece21 100644 --- a/eeschema/tools/sch_line_wire_bus_tool.cpp +++ b/eeschema/tools/sch_line_wire_bus_tool.cpp @@ -757,6 +757,9 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType, segment = doUnfoldBus( net, contextMenuPos ); } } + //------------------------------------------------------------------------ + // Handle TOOL_ACTION special cases + // else if( evt->IsAction( &EE_ACTIONS::rotateCW ) || evt->IsAction( &EE_ACTIONS::rotateCCW ) ) { if( m_busUnfold.in_progress ) diff --git a/eeschema/tools/sch_move_tool.cpp b/eeschema/tools/sch_move_tool.cpp index b3b87332fd..2624593101 100644 --- a/eeschema/tools/sch_move_tool.cpp +++ b/eeschema/tools/sch_move_tool.cpp @@ -446,6 +446,11 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) } } } + else if( evt->IsAction( &EE_ACTIONS::highlightNet ) + || evt->IsAction( &EE_ACTIONS::explicitCrossProbe ) ) + { + // These don't make any sense during a move. Eat them. + } //------------------------------------------------------------------------ // Handle context menu //