Fix failed assert when literal null is returned

dev-new-models
melex750 2016-08-06 04:56:57 -04:00 committed by GitHub
parent fad38cd0e9
commit e48188b429
1 changed files with 6 additions and 1 deletions

View File

@ -135,9 +135,14 @@ bool CBotExprRetVar::Execute(CBotStack* &pj)
{
pVar = pj->GetVar();
pVar->Update(pj->GetUserPtr());
if (pVar->GetType(CBotVar::GetTypeMode::CLASS_AS_POINTER) == CBotTypNullPointer)
{
pile1->SetError(CBotErrNull, &m_token);
return pj->Return(pile1);
}
if ( !m_next3->ExecuteVar(pVar, pile, &m_token, true, false) )
return false;
return false;
if (pVar)
pile1->SetCopyVar(pVar);