Fix Coverity warning.

This commit is contained in:
Jeff Young 2021-05-21 14:38:15 +01:00
parent 3de60231db
commit 4a77a4080d
1 changed files with 2 additions and 2 deletions

View File

@ -1114,13 +1114,13 @@ void UOP::Exec( CONTEXT* ctx )
if( ctx->HasErrorCallback() ) if( ctx->HasErrorCallback() )
{ {
if( arg1->GetType() == VT_STRING && arg2->GetType() == VT_NUMERIC ) if( arg1 && arg1->GetType() == VT_STRING && arg2 && arg2->GetType() == VT_NUMERIC )
{ {
ctx->ReportError( wxString::Format( _( "Type mismatch between '%s' and %lf" ), ctx->ReportError( wxString::Format( _( "Type mismatch between '%s' and %lf" ),
arg1->AsString(), arg1->AsString(),
arg2->AsDouble() ) ); arg2->AsDouble() ) );
} }
else if( arg1->GetType() == VT_NUMERIC && arg2->GetType() == VT_STRING ) else if( arg1 && arg1->GetType() == VT_NUMERIC && arg2 && arg2->GetType() == VT_STRING )
{ {
ctx->ReportError( wxString::Format( _( "Type mismatch between %lf and '%s'" ), ctx->ReportError( wxString::Format( _( "Type mismatch between %lf and '%s'" ),
arg1->AsDouble(), arg1->AsDouble(),