Skip to content

Commit a4d8c7e

Browse files
committed
fix(menus): PerformMenuAction empty vector
1 parent 9584e21 commit a4d8c7e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/server/menus/MenuRenderer.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,12 @@ void MenuRenderer::PerformMenuAction(std::string button)
245245
{
246246
CCommand tokenizedArgs;
247247
tokenizedArgs.Tokenize(cmd.c_str());
248+
if (tokenizedArgs.ArgC() <= 0) return;
248249

249250
std::string commandName = (tokenizedArgs[0] + 3);
250251

251252
std::vector<std::string> argsplit = TokenizeCommand(cmd.c_str());
252-
argsplit.erase(argsplit.begin());
253+
if (argsplit.size() > 0) argsplit.erase(argsplit.begin());
253254

254255
if (g_commandsManager.FetchCommand(commandName) == nullptr)
255256
return;

0 commit comments

Comments
 (0)