- replaced assert() in ZScript fields compilation code

Field pointer can be null if error occurred while compiling its definition
This commit is contained in:
alexey.lysiuk 2020-03-14 12:33:36 +02:00
parent 13e6ea7796
commit b9d4ce052b

View file

@ -1559,9 +1559,7 @@ bool ZCCCompiler::CompileFields(PContainerType *type, TArray<ZCC_VarDeclarator *
Error(field, "Cannot declare non-native global variables. Tried to declare %s", FName(name->Name).GetChars());
}
assert(f != nullptr);
if (field->Flags & (ZCC_Version | ZCC_Deprecated))
if ((field->Flags & (ZCC_Version | ZCC_Deprecated)) && f != nullptr)
{
f->mVersion = field->Version;