diff options
author | mekolat <mekolat@users.noreply.github.com> | 2016-04-24 13:46:11 -0400 |
---|---|---|
committer | mekolat <mekolat@users.noreply.github.com> | 2016-04-24 14:03:35 -0400 |
commit | 6fac3210f0de07ab1ff483875ac517a3eea7367a (patch) | |
tree | 95330adc85016873f711265383a2c60cdecfdd7e /src | |
parent | 543bdef8acecf4456d42c73fb712e570b01dc741 (diff) | |
download | tmwa-6fac3210f0de07ab1ff483875ac517a3eea7367a.tar.gz tmwa-6fac3210f0de07ab1ff483875ac517a3eea7367a.tar.bz2 tmwa-6fac3210f0de07ab1ff483875ac517a3eea7367a.tar.xz tmwa-6fac3210f0de07ab1ff483875ac517a3eea7367a.zip |
check for null pointer where npc_dialog_mes is used
Diffstat (limited to 'src')
-rw-r--r-- | src/map/script-fun.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index fc555ad..b73a8fc 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -90,6 +90,8 @@ static void builtin_mes(ScriptState *st) { dumb_ptr<map_session_data> sd = script_rid2sd(st); + if (sd == nullptr) + return; sd->state.npc_dialog_mes = 1; RString mes = HARG(0) ? conv_str(st, &AARG(0)) : ""_s; clif_scriptmes(sd, st->oid, mes); @@ -327,6 +329,8 @@ void builtin_close(ScriptState *st) } st->state = ScriptEndState::END; dumb_ptr<map_session_data> sd = script_rid2sd(st); + if (sd == nullptr) + return; if (sd->state.npc_dialog_mes) clif_scriptclose(sd, st->oid); else @@ -338,6 +342,8 @@ void builtin_close2(ScriptState *st) { st->state = ScriptEndState::STOP; dumb_ptr<map_session_data> sd = script_rid2sd(st); + if (sd == nullptr) + return; if (sd->state.npc_dialog_mes) clif_scriptclose(sd, st->oid); else |