roy-t / AStar

A fast 2D path finding library based on the A* algorithm. Works with both grids and graphs. Supports any .NET variant that supports .NETStandard 2.0 or higher. This library has no external dependencies. The library is licensed under the MIT license.
http://roy-t.nl
MIT License
340 stars 60 forks source link

PathFinder.FindPath can return null, Grid.GetPath doesn't handle this resulting in an exception. #15

Closed Dan-Matt closed 6 years ago

Dan-Matt commented 6 years ago

If PathFinder.FindPath returns null, Grid.GetPath doesn't check for it and throws an exception.

roy-t commented 6 years ago

@EnderYoss damn, I somehow deleted that check when moving form v1 to v2. My bad. I'll try to bring out a fix on friday. Thanks so much for the report!

(This is why I should've made unit tests people! :P)

Dan-Matt commented 6 years ago

No problem, and yeah you'll have to get some in there! Thanks for the code by the way!

roy-t commented 6 years ago

I've fixed this in version 2.1.0. It should be indexed by Nuget.org in an hour. I've also added some unit tests to prevent this from happening again. Thanks again for reporting the issue!

Dan-Matt commented 6 years ago

Awesome thanks, no problem!