Skip to content

Commit

Permalink
Merge branch 'master' into release/0.27
Browse files Browse the repository at this point in the history
  • Loading branch information
Tilps committed Feb 6, 2021
2 parents 59bbaa5 + 5d0d375 commit 2e9badd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/mcts/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,12 @@ void NodeTree::MakeMove(Move move) {
break;
}
}
if (new_head == nullptr) throw Exception("Invalid move!");
// If the node has edges populated and new_head is null then an illegal move
// was attempted. This is not compatible with solid children implementation
// of ReleaseChildren, so abort here.
if (current_head_->HasChildren() && new_head == nullptr) {
throw Exception("Invalid move!");
}
move = board.GetModernMove(move);
current_head_->ReleaseChildrenExceptOne(new_head);
new_head = current_head_->child_.get();
Expand Down

0 comments on commit 2e9badd

Please sign in to comment.