Skip to content

Commit 9b9f353

Browse files
committed
fixed CLI crash then nothing is typed
1 parent 097754c commit 9b9f353

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/cli/commandManager.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ void CommandManager::registerCommand(std::unique_ptr<Command>&& command) {
2121
}
2222

2323
void CommandManager::run(const std::vector<std::string>& commandArgs, Environment& environment) {
24+
if (commandArgs.empty()) {
25+
return; // do nothing
26+
}
2427
auto iter = commandMap.find(commandArgs[0]);
2528
if (iter == commandMap.end()) {
2629
logError("Failed to run nonexistent command {}. Use the \"help\" command for a list of commands.", "CommandManager", commandArgs[0]);

0 commit comments

Comments
 (0)