Push a non-existent ref's value as 0. (Don't just crash.)

Fixes https://gitlab.com/kicad/code/kicad/issues/7971
This commit is contained in:
Jeff Young 2021-03-20 11:04:36 +00:00
parent 4073153e75
commit b1fa02bcc8
1 changed files with 5 additions and 2 deletions

View File

@ -1088,8 +1088,11 @@ void UOP::Exec( CONTEXT* ctx )
{
case TR_UOP_PUSH_VAR:
{
auto value = ctx->AllocValue();
value->Set( m_ref->GetValue( ctx ) );
VALUE* value = ctx->AllocValue();
if( m_ref )
value->Set( m_ref->GetValue( ctx ) );
ctx->Push( value );
}
break;