Skip to content
Permalink
Browse files

- replaced assert() in ZScript fields compilation code

Field pointer can be null if error occurred while compiling its definition
  • Loading branch information
alexey-lysiuk committed Mar 14, 2020
1 parent 13e6ea7 commit b9d4ce052b10e8d93d3e32b09e3bf5d6c843247f
Showing with 1 addition and 3 deletions.
  1. +1 −3 src/scripting/zscript/zcc_compile.cpp
@@ -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;

0 comments on commit b9d4ce0

Please sign in to comment.
You can’t perform that action at this time.