From 34d21d4056884f598bbd0e18862607afa9644134 Mon Sep 17 00:00:00 2001 From: Chris Miles Date: Mon, 6 Feb 2023 17:24:24 -0600 Subject: [PATCH] [Crash] Fix command crash with #npcedit weapon when second weapon not passed ni (#2829) --- zone/gm_commands/npcedit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zone/gm_commands/npcedit.cpp b/zone/gm_commands/npcedit.cpp index ddabd6380..a55037d05 100755 --- a/zone/gm_commands/npcedit.cpp +++ b/zone/gm_commands/npcedit.cpp @@ -536,14 +536,14 @@ void command_npcedit(Client *c, const Seperator *sep) } else if (!strcasecmp(sep->arg[1], "weapon")) { if (sep->IsNumber(2)) { auto primary_model = std::stoul(sep->arg[2]); - uint32_t secondary_model = sep->IsNumber(3) ? std::stoul(sep->arg[3]) : 0; + uint32_t secondary_model = sep->arg[3] && sep->IsNumber(3) ? std::stoul(sep->arg[3]) : 0; n.d_melee_texture1 = primary_model; n.d_melee_texture2 = secondary_model; d = fmt::format( "{} will have Model {} set to their Primary and Model {} set to their Secondary on repop.", npc_id_string, Strings::Commify(sep->arg[2]), - sep->IsNumber(3) ? Strings::Commify(sep->arg[3]) : 0 + sep->arg[3] && sep->IsNumber(3) ? Strings::Commify(sep->arg[3]) : 0 ); } else { c->Message(