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:
parent
397cf146a1
commit
e7933b5661
@ -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() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user