Commit e33b50d9 authored by Max Kellermann's avatar Max Kellermann

command/all: simplify `return` from command_process()

parent 21fa44c0
...@@ -409,12 +409,10 @@ try { ...@@ -409,12 +409,10 @@ try {
const struct command *cmd = const struct command *cmd =
command_checked_lookup(r, client.GetPermission(), command_checked_lookup(r, client.GetPermission(),
cmd_name, args); cmd_name, args);
if (cmd == nullptr)
return CommandResult::ERROR;
CommandResult ret = cmd return cmd->handler(client, args, r);
? cmd->handler(client, args, r)
: CommandResult::ERROR;
return ret;
} catch (...) { } catch (...) {
Response r(client, num); Response r(client, num);
PrintError(r, std::current_exception()); PrintError(r, std::current_exception());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment