fix(Core/Tickets): Fix crash in ticket complete command. (#21665)

This commit is contained in:
Anton Popovichenko
2025-03-07 21:52:47 +01:00
committed by GitHub
parent 263f14d800
commit 3406cb03b3

View File

@@ -199,7 +199,7 @@ public:
return true;
}
static bool HandleGMTicketCompleteCommand(ChatHandler* handler, uint32 ticketId)
static bool HandleGMTicketCompleteCommand(ChatHandler* handler, uint32 ticketId, std::optional<std::string> response)
{
GmTicket* ticket = sTicketMgr->GetTicket(ticketId);
if (!ticket || ticket->IsClosed() || ticket->IsCompleted())
@@ -217,9 +217,8 @@ public:
return true;
}
char* response = strtok(nullptr, "\n");
if (response)
ticket->AppendResponse(response);
ticket->AppendResponse(response.value());
if (Player* player2 = ticket->GetPlayer())
{