summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/scripting/lua.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/scripting/lua.cpp b/src/scripting/lua.cpp
index 4cd2c52f..4ea86985 100644
--- a/src/scripting/lua.cpp
+++ b/src/scripting/lua.cpp
@@ -196,6 +196,11 @@ static int npc_end(lua_State *s)
NPC *p = getNPC(s, 1);
Character *q = getCharacter(s, 2);
+ if (!p || !q)
+ {
+ raiseScriptError(s, "npc_end called with incorrect parameters.");
+ return 0;
+ }
MessageOut msg(GPMSG_NPC_CLOSE);
msg.writeShort(p->getPublicID());