Skip to content

Commit

Permalink
Fixes a bug in GoReply when no valid moves were found
Browse files Browse the repository at this point in the history
  • Loading branch information
fathzer committed Nov 23, 2024
1 parent 2fac0d9 commit c50ab7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/fathzer/jchess/uci/GoReply.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public String toString() {
* @return The line or an empty optional if no information is available
*/
public Optional<String> getMainInfoString() {
return getInfoString(0);
return bestMove==null ? Optional.empty() : getInfoString(0);
}

/** Gets the uci info line to return just before sending the reply.
Expand Down

0 comments on commit c50ab7c

Please sign in to comment.