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,9 +28,14 @@ class ChessBoardSquare extends React.Component {
isSelectedSquare() { isSelectedSquare() {
var { store } = this.props; var { store } = this.props;
if (store.getState().selectedSquare == null) {
return false;
}
else {
return this.squareCoords().rank == store.getState().selectedSquare.rank return this.squareCoords().rank == store.getState().selectedSquare.rank
&& this.squareCoords().file == store.getState().selectedSquare.file; && this.squareCoords().file == store.getState().selectedSquare.file;
} }
}
render() { render() {
if (this.props.piece == undefined) { if (this.props.piece == undefined) {