sch_symbol: use fail message fall back to dummy symbol when passed null

This commit is contained in:
Mike Williams 2024-06-10 11:24:58 -04:00
parent 012d3f098f
commit e0e837189d
1 changed files with 6 additions and 1 deletions

View File

@ -35,6 +35,7 @@
#include <trigo.h>
#include <refdes_utils.h>
#include <wx/log.h>
#include <wx/debug.h>
#include <settings/settings_manager.h>
#include <sch_plotter.h>
#include <string_utils.h>
@ -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();