From 1dbe8442b12599e363f7de8aa452b1cfa71168e3 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 28 Oct 2021 11:51:04 +0200 Subject: [PATCH] fp editor: fix crash (null pointer) when trying to drag an item. (there is no roter tool in fp editor) Fixes #9476 https://gitlab.com/kicad/code/kicad/issues/9476 --- 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 75636ad832..3718a3dd6b 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -273,6 +273,9 @@ bool EDIT_TOOL::isRouterActive() const int EDIT_TOOL::Drag( const TOOL_EVENT& aEvent ) { + if( !m_toolMgr->GetTool() ) + return false; // don't drag when no router tool (i.e. fp editor) + if( m_toolMgr->GetTool()->IsToolActive() ) return false; // don't drag when router is already active