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 Apr 29, 2024
1 parent 5fb6a93 commit ee1c282
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 ee1c282

Please sign in to comment.