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

Error: TypeError: Cannot set properties of undefined (setting 'g') #199

Open
Stevenbdl opened this issue Oct 20, 2021 · 1 comment
Open

Comments

@Stevenbdl
Copy link

Issue path: src/finders/JumpPointFinderBase.js

Issue detailed
Line where is issue

My solution:
startNode = this.startNode = grid.getNodeAt(startX, startY) || {}

@ZoranRavic
Copy link

None of the methods check if you picked a point inside of the grid, they all expect you to make sure you only pick start position and end position that is inside of the grid.

Your solutions only avoids the exception, but since the algorithm will never be able to find a path that leads outside of the grid you would be better off just canceling the pathfinding operation right away.

Anyway I don't think this lib needs to handle that for you.

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

2 participants