diff --git a/src/logic/future_moves.rs b/src/logic/future_moves.rs index d76b640..fa3efd9 100644 --- a/src/logic/future_moves.rs +++ b/src/logic/future_moves.rs @@ -355,14 +355,14 @@ impl FutureMoves { } fn get_board_from_idx(&self, idx: usize) -> Option { - self.move_history(idx).map(|hist| { + self.move_history(idx).and_then(|hist| { let mut board = self.board; for (m, c) in hist { if let Some(m) = m { - board.place(m, c).expect("move would not propegate"); + board.place(m, c).ok()?; } } - board + Some(board) }) }