From c1a6aa0752d94398e26f150b22f75d548455a9f1 Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Mon, 25 Aug 2025 21:53:28 -0400 Subject: [PATCH] Script/Commands: Fix crash in `.pet create` command if Unit::CreateTamedPetFrom returns null Port From (https://github.com/TrinityCore/TrinityCore/commit/33a8d42bd79265dcc6930b67f8ceb26622d5e0fe) --- Source/Game/Chat/Commands/PetCommands.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/Game/Chat/Commands/PetCommands.cs b/Source/Game/Chat/Commands/PetCommands.cs index 606ea3da4..a5fe513d1 100644 --- a/Source/Game/Chat/Commands/PetCommands.cs +++ b/Source/Game/Chat/Commands/PetCommands.cs @@ -39,6 +39,11 @@ namespace Game.Chat // Everything looks OK, create new pet Pet pet = player.CreateTamedPetFrom(creatureTarget); + if (pet == null) + { + handler.SendSysMessage("CreateTamedPetFrom returned null."); + return false; + } // "kill" original creature creatureTarget.DespawnOrUnsummon();