From adde48010eb4b1bfa57fb56251014dfc90e09cd8 Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Mon, 9 Jun 2025 09:16:10 -0400 Subject: [PATCH] schematic: avoid crash on missing tool --- eeschema/sch_base_frame.cpp | 9 +++++++++ eeschema/sch_base_frame.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/eeschema/sch_base_frame.cpp b/eeschema/sch_base_frame.cpp index 0fdae243d2..991fe49d08 100644 --- a/eeschema/sch_base_frame.cpp +++ b/eeschema/sch_base_frame.cpp @@ -789,3 +789,12 @@ void SCH_BASE_FRAME::OnSymChangeDebounceTimer( wxTimerEvent& aEvent ) Kiway().ExpressMail( FRAME_SCH_SYMBOL_EDITOR, MAIL_REFRESH_SYMBOL, libName ); } } + + +SCH_SELECTION_TOOL* SCH_BASE_FRAME::GetSelectionTool() +{ + if( m_toolManager ) + return m_toolManager->GetTool(); + + return nullptr; +} diff --git a/eeschema/sch_base_frame.h b/eeschema/sch_base_frame.h index d026df239e..8c876b5c90 100644 --- a/eeschema/sch_base_frame.h +++ b/eeschema/sch_base_frame.h @@ -267,6 +267,8 @@ public: m_watcherLastModified = aTime; } + SCH_SELECTION_TOOL* GetSelectionTool() override; + protected: void handleActivateEvent( wxActivateEvent& aEvent ) override;