Fixed crash on attempt to get string value of null

https://mantis.zdoom.org/view.php?id=231
This commit is contained in:
alexey.lysiuk 2017-02-10 16:19:33 +02:00
parent 98de1fcfcb
commit d2affc7c0c

View file

@ -69,7 +69,7 @@ static FString GetStringConst(FxExpression *ex, FCompileContext &ctx)
{
ex = new FxStringCast(ex);
ex = ex->Resolve(ctx);
return static_cast<FxConstant*>(ex)->GetValue().GetString();
return ex ? static_cast<FxConstant*>(ex)->GetValue().GetString() : FString();
}
int ZCCCompiler::IntConstFromNode(ZCC_TreeNode *node, PStruct *cls)