[Board] Add check for Optional

This commit is contained in:
2022-12-21 17:26:56 +01:00
parent 274c29eabd
commit 7f84154d30

View File

@@ -51,6 +51,8 @@ CastlingRights Board::castlingRights() const {
} }
void Board::setEnPassantSquare(const Square::Optional &square) { void Board::setEnPassantSquare(const Square::Optional &square) {
if (!square.has_value())
return;
mEPS = square->index(); mEPS = square->index();
} }