From e0e837189defe1f61e8ae37a3979c832eb34a7d7 Mon Sep 17 00:00:00 2001 From: Mike Williams Date: Mon, 10 Jun 2024 11:24:58 -0400 Subject: [PATCH] sch_symbol: use fail message fall back to dummy symbol when passed null --- eeschema/sch_symbol.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_symbol.cpp b/eeschema/sch_symbol.cpp index b0094dbc72..0356daf8a0 100644 --- a/eeschema/sch_symbol.cpp +++ b/eeschema/sch_symbol.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -230,7 +231,11 @@ wxString SCH_SYMBOL::GetSchSymbolLibraryName() const void SCH_SYMBOL::SetLibSymbol( const LIB_SYMBOL* aLibSymbol ) { - wxASSERT_MSG( aLibSymbol, wxT( "SCH_SYMBOL::SetLibSymbol() called with NULL pointer" ) ); + if( !aLibSymbol ) + { + wxFAIL_MSG( "SCH_SYMBOL::SetLibSymbol() called with NULL pointer" ); + aLibSymbol = LIB_SYMBOL::Dummy(); + } m_part.reset( aLibSymbol->Flatten().release() ); m_part->SetParent();