fixed case moves not existing

This commit is contained in:
mig 2017-04-09 17:07:43 +02:00
parent 484400b36d
commit 8d55f84b01

View file

@ -762,7 +762,7 @@ if(typeof process!=="undefined" && process.title === "node") {
return evaluation;
}
if(aGame.mBoard.mMoves.length==0)
if(!aGame.mBoard.mMoves || aGame.mBoard.mMoves.length==0)
aGame.mBoard.GenerateMoves(aGame);
if(aGame.mBoard.mMoves.length==1) { // only one possible move: pick it
aGame.mBestMoves=[aGame.mBoard.mMoves[0]];