From a2772b3363eb4ae74bbc0dc7ca58136d6166e478 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 | 4 ++-- eeschema/tools/sch_line_wire_bus_tool.cpp | 3 +++ eeschema/tools/sch_move_tool.cpp | 5 +++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/eeschema/sch_item.cpp b/eeschema/sch_item.cpp index ff4e69bc40..b7f4469430 100644 --- a/eeschema/sch_item.cpp +++ b/eeschema/sch_item.cpp @@ -141,8 +141,8 @@ SCH_CONNECTION* SCH_ITEM::Connection( const SCH_SHEET_PATH* aSheet ) const if( !IsConnectable() ) return nullptr; - wxASSERT_MSG( !IsConnectivityDirty(), - "Shouldn't be asking for connection if connectivity is dirty!" ); + wxCHECK_MSG( !IsConnectivityDirty(), nullptr, + wxT( "Shouldn't be asking for connection if connectivity is dirty!" ) ); if( !aSheet ) aSheet = &Schematic()->CurrentSheet(); diff --git a/eeschema/tools/sch_line_wire_bus_tool.cpp b/eeschema/tools/sch_line_wire_bus_tool.cpp index 711ca50d72..b25e070e2b 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 6b3da856f5..4ec91b5348 100644 --- a/eeschema/tools/sch_move_tool.cpp +++ b/eeschema/tools/sch_move_tool.cpp @@ -787,6 +787,11 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent ) } } } + else if( evt->IsAction( &EE_ACTIONS::highlightNet ) + || evt->IsAction( &EE_ACTIONS::selectOnPCB ) ) + { + // These don't make any sense during a move. Eat them. + } //------------------------------------------------------------------------ // Handle context menu //