1
0
mirror of https://github.com/danbee/chess synced 2025-03-04 08:39:06 +00:00

Fix problem with null selectedSquare

This commit is contained in:
Daniel Barber 2016-12-08 14:52:26 +00:00
parent 397cf146a1
commit e7933b5661

View File

@ -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() {