diff --git a/src/scripting/vm/vmframe.cpp b/src/scripting/vm/vmframe.cpp index d5eaed5bd8..10fed9abb6 100644 --- a/src/scripting/vm/vmframe.cpp +++ b/src/scripting/vm/vmframe.cpp @@ -446,7 +446,8 @@ int VMFrameStack::Call(VMFunction *func, VMValue *params, int numparams, VMRetur { auto code = static_cast(func)->Code; // handle empty functions consisting of a single return explicitly so that empty virtual callbacks do not need to set up an entire VM frame. - if (code->word == 0x0080804e) + // code cann be null here in case of some non-fatal DECORATE errors. + if (code == nullptr || code->word == 0x0080804e) { return 0; }