Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to call onMovePiece callback even when it isn't defined #9

Closed
jniemann66 opened this issue Apr 22, 2017 · 1 comment
Closed

Comments

@jniemann66
Copy link
Owner

In chessdiagram.js, the introduction 'allowMoves' was a good idea.
However, there should be an additional safeguard against the case where allowMoves is true, but onMovePiece is undefined.

I propose the following change to Chessdiagram.js, line 64:

_onMovePiece(pieceType, from, to) {
	if (this.props.allowMoves && this.props.onMovePiece) {
		this.props.onMovePiece(pieceType, from, to);
	}
}
@jniemann66
Copy link
Owner Author

fixed in f4e480c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant