From 43ea6fbaa1e4ee264cc8b24f0ef4ac68743a87d6 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 2 Oct 2022 21:50:21 -0400 Subject: [PATCH] Core/Commands: Fixes a few crashes with commands --- Source/Game/Chat/CommandArgs.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Game/Chat/CommandArgs.cs b/Source/Game/Chat/CommandArgs.cs index f91db7eb2..2a15e039b 100644 --- a/Source/Game/Chat/CommandArgs.cs +++ b/Source/Game/Chat/CommandArgs.cs @@ -277,7 +277,7 @@ namespace Game.Chat case nameof(ItemTemplate): { ChatCommandResult result = TryConsume(out dynamic tempVal, typeof(uint), handler, args); - if (!result.IsSuccessful() || (val = Global.ObjectMgr.GetItemTemplate(tempVal))) + if (!result.IsSuccessful() || (val = Global.ObjectMgr.GetItemTemplate(tempVal)) != null) return result; return ChatCommandResult.FromErrorMessage(handler.GetParsedString(CypherStrings.CmdparserItemNoExist, tempVal)); @@ -293,7 +293,7 @@ namespace Game.Chat case nameof(Quest): { ChatCommandResult result = TryConsume(out dynamic tempVal, typeof(uint), handler, args); - if (!result.IsSuccessful() || (val = Global.ObjectMgr.GetQuestTemplate(tempVal))) + if (!result.IsSuccessful() || (val = Global.ObjectMgr.GetQuestTemplate(tempVal)) != null) return result; return ChatCommandResult.FromErrorMessage(handler.GetParsedString(CypherStrings.CmdparserQuestNoExist, tempVal));