7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 21:43:43 +00:00

Fix issue that caused assert failure in parser

Missing `else` when adding optional caused everything to fall through.
This commit is contained in:
Seth Hillbrand 2024-12-23 08:36:46 -08:00
parent 66ee4a1ddd
commit 78a6640ad6

View File

@ -484,7 +484,7 @@ std::unique_ptr<LIBEVAL::VAR_REF> PCBEXPR_UCODE::CreateVarRef( const wxString& a
{
vref->SetType( LIBEVAL::VT_NUMERIC );
}
if( prop->TypeHash() == TYPE_HASH( std::optional<int> ) )
else if( prop->TypeHash() == TYPE_HASH( std::optional<int> ) )
{
vref->SetType( LIBEVAL::VT_NUMERIC );
vref->SetIsOptional();
@ -504,7 +504,8 @@ std::unique_ptr<LIBEVAL::VAR_REF> PCBEXPR_UCODE::CreateVarRef( const wxString& a
}
else
{
wxFAIL_MSG( wxT( "PCBEXPR_UCODE::createVarRef: Unknown property type." ) );
wxString msg = wxString::Format( wxT( "PCBEXPR_UCODE::createVarRef: Unknown property type %s from %s." ), cls.name, field );
wxFAIL_MSG( msg );
}
}
}