Skip to content

Prevented crash from faulty data - #9

Open
MightbeMagic wants to merge 1 commit into
juliangarnier:masterfrom
MightbeMagic:master
Open

Prevented crash from faulty data#9
MightbeMagic wants to merge 1 commit into
juliangarnier:masterfrom
MightbeMagic:master

Conversation

@MightbeMagic

Copy link
Copy Markdown

Chess.js library returns a location string with only a number and causes the player to be locked with the piece, not letting them move it at all. This code checks if the string is the correct length before allowing it through in hideMoves and showMoves to prevent the error from being thrown, as it runs just fine so long as that faulty object is excluded.

Chess.js library returns a location string with only a number and causes the player to be locked with the piece, not letting them move it at all. This code checks if the string is the correct length before allowing it through in hideMoves and showMoves to prevent the error from being thrown, as it runs just fine so long as that faulty object is excluded.

@thenewsupercell thenewsupercell left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@thenewsupercell

Copy link
Copy Markdown

this is the correct solution, should be merged to master

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

Successfully merging this pull request may close these issues.

3 participants