diff --git a/src/thingdef/thingdef_states.cpp b/src/thingdef/thingdef_states.cpp index 5b54d684d..49febd06e 100644 --- a/src/thingdef/thingdef_states.cpp +++ b/src/thingdef/thingdef_states.cpp @@ -361,6 +361,10 @@ endofstate: void AddImplicitReturn(FxSequence *code, const PPrototype *proto, FScanner &sc) { + if (code == NULL) + { + return; + } if (proto == NULL || proto->ReturnTypes.Size() == 0) { // Returns nothing. Good. We can safely add an implied return. code->Add(new FxReturnStatement(NULL, sc));