From c9be0fb86886e58daf322c0f20a2b8e9e7c77df9 Mon Sep 17 00:00:00 2001 From: stujones11 Date: Sat, 16 Aug 2014 16:53:23 +0100 Subject: [PATCH] Prevent crash if NPC name is nil --- npcf/npcf.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/npcf/npcf.lua b/npcf/npcf.lua index abe5ba7..06ec4cf 100644 --- a/npcf/npcf.lua +++ b/npcf/npcf.lua @@ -105,7 +105,9 @@ local function get_valid_player_name(player) end local function get_valid_npc_name(npc_name) - return npc_name:len() <= 12 and npc_name:match("^[A-Za-z0-9%_%-]+$") + if npc_name then + return npc_name:len() <= 12 and npc_name:match("^[A-Za-z0-9%_%-]+$") + end end local function get_valid_entity(luaentity)