Skip to content

Commit 557902e

Browse files
committed
fix: fix onExecute out of range
1 parent cca5dbb commit 557902e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/legacy/api/CommandAPI.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,12 @@ void onExecute(CommandOrigin const& origin, CommandOutput& output, RuntimeComman
339339
return;
340340
}
341341
for (std::string& name : registeredCommands[commandName]) {
342-
auto& param = runtime[name];
343-
args.set(name, convertResult(param, origin, output));
342+
try {
343+
auto& param = runtime[name];
344+
args.set(name, convertResult(param, origin, output));
345+
} catch (std::out_of_range&) {
346+
continue;
347+
}
344348
}
345349
localShareData->commandCallbacks[commandName].func.get().call({}, cmd, ori, outp, args);
346350
}

0 commit comments

Comments
 (0)