fix a null reference when checking for legal en passant moves
This commit is contained in:
parent
c20dda886a
commit
5011cfed8c
|
|
@ -228,7 +228,7 @@ function legalMoves(board, side, type, from, canCapture){
|
|||
if (there) {
|
||||
if (boardGet(board, there, otherSide(side)) !== ' ') {
|
||||
legals.push(there);
|
||||
} else {
|
||||
} else if (forward2) {
|
||||
let otherBoard = board;
|
||||
while (otherBoard && otherBoard.move && otherBoard.move.side[0] === side[0]) {
|
||||
otherBoard = otherBoard.prior;
|
||||
|
|
|
|||
Loading…
Reference in New Issue