diff --git a/src/scripting/decorate/thingdef_parse.cpp b/src/scripting/decorate/thingdef_parse.cpp index bad24c872..43330d58f 100644 --- a/src/scripting/decorate/thingdef_parse.cpp +++ b/src/scripting/decorate/thingdef_parse.cpp @@ -62,7 +62,14 @@ EXTERN_CVAR(Bool, strictdecorate); PClassActor *DecoDerivedClass(const FScriptPosition &sc, PClassActor *parent, FName typeName) { - if (parent->VMType->mVersion > MakeVersion(2, 0)) + const PClassType *const parentVMType = parent->VMType; + + if (parentVMType == nullptr) + { + // Abort when forward declared class is used as a parent. This edge case cannot be handled gracefully. + sc.Message(MSG_FATAL, "Tried to define class '%s' without definition of parent class '%s'.", typeName.GetChars(), parent->TypeName.GetChars()); + } + else if (parentVMType->mVersion > MakeVersion(2, 0)) { sc.Message(MSG_ERROR, "Parent class %s of %s not accessible to DECORATE", parent->TypeName.GetChars(), typeName.GetChars()); }