PathFinding.js
PathFinding.js copied to clipboard
Error: TypeError: Cannot set properties of undefined (setting 'g')
Issue path: src/finders/JumpPointFinderBase.js
Issue detailed Line where is issue
My solution:
startNode = this.startNode = grid.getNodeAt(startX, startY) || {}
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.