Skip to content

Commit

Permalink
checking if 'name' parameter was provided with 'setoption' before pro…
Browse files Browse the repository at this point in the history
…ceeding with execution

adressing issue LeelaChessZero#1843
  • Loading branch information
KarlKfoury authored Aug 31, 2024
1 parent d298c04 commit ecf3edd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/chess/uciloop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,13 @@ bool UciLoop::DispatchCommand(
} else if (command == "isready") {
CmdIsReady();
} else if (command == "setoption") {
if (GetOrEmpty(params, "name").empty()) {
throw Exception("setoption requires name");
}
else {
CmdSetOption(GetOrEmpty(params, "name"), GetOrEmpty(params, "value"),
GetOrEmpty(params, "context"));
}
} else if (command == "ucinewgame") {
CmdUciNewGame();
} else if (command == "position") {
Expand Down

0 comments on commit ecf3edd

Please sign in to comment.