Scripts/Commands: Fix a crash in .help - closes #25360

(cherry picked from commit 944f49d613)
This commit is contained in:
Treeston
2020-08-30 13:45:04 +02:00
committed by Shauren
parent 45e9e94311
commit a65e7e0213
2 changed files with 11 additions and 9 deletions

View File

@@ -699,16 +699,16 @@ public:
return true;
}
static bool HandleHelpCommand(ChatHandler* handler, Optional<std::string> cmdArg)
static bool HandleHelpCommand(ChatHandler* handler, Tail cmdArg)
{
if (!cmdArg)
if (cmdArg.empty())
{
handler->ShowHelpForCommand(ChatHandler::getCommandTable(), "help");
handler->ShowHelpForCommand(ChatHandler::getCommandTable(), "");
}
else
{
if (!handler->ShowHelpForCommand(ChatHandler::getCommandTable(), cmdArg->c_str()))
if (!handler->ShowHelpForCommand(ChatHandler::getCommandTable(), std::string(cmdArg).c_str()))
handler->SendSysMessage(LANG_NO_HELP_CMD);
}