diff --git a/app/components/chess-board-square.js b/app/components/chess-board-square.js index 3279f1b..25c254e 100644 --- a/app/components/chess-board-square.js +++ b/app/components/chess-board-square.js @@ -28,8 +28,13 @@ class ChessBoardSquare extends React.Component { isSelectedSquare() { var { store } = this.props; - return this.squareCoords().rank == store.getState().selectedSquare.rank - && this.squareCoords().file == store.getState().selectedSquare.file; + if (store.getState().selectedSquare == null) { + return false; + } + else { + return this.squareCoords().rank == store.getState().selectedSquare.rank + && this.squareCoords().file == store.getState().selectedSquare.file; + } } render() {