From 4d35b128089da52efc69c62dc0993f1aa47778bd Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 19 Jul 2018 13:38:49 +0300 Subject: [PATCH] - fixed crash on accessing state owner during VM abort https://forum.zdoom.org/viewtopic.php?t=61338 --- src/info.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/info.cpp b/src/info.cpp index dd87e85f6..4022e8b2a 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -154,14 +154,18 @@ bool FState::CallAction(AActor *self, AActor *stateowner, FStateParamInfo *info, catch (CVMAbortException &err) { err.MaybePrintMessage(); - const char *callinfo = ""; - if (info != nullptr && info->mStateType == STATE_Psprite) + + if (stateowner != nullptr) { - if (stateowner->IsKindOf(NAME_Weapon) && stateowner != self) callinfo = "weapon "; - else callinfo = "overlay "; + const char *callinfo = ""; + if (info != nullptr && info->mStateType == STATE_Psprite) + { + if (stateowner->IsKindOf(NAME_Weapon) && stateowner != self) callinfo = "weapon "; + else callinfo = "overlay "; + } + err.stacktrace.AppendFormat("Called from %sstate %s in %s\n", callinfo, FState::StaticGetStateName(this).GetChars(), stateowner->GetClass()->TypeName.GetChars()); } - err.stacktrace.AppendFormat("Called from %sstate %s in %s\n", callinfo, FState::StaticGetStateName(this).GetChars(), stateowner->GetClass()->TypeName.GetChars()); - throw; + throw; }