Skip to content

Commit a2273b7

Browse files
committed
Fixed egde case with checking grid bounds
1 parent 5f10131 commit a2273b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/_PathFinder_/AStar/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function AStar(s, e, row, col, inputGrid) {
1111
const end = e;
1212
const path = [];
1313

14-
if (end.i > inputGrid.length || end.j > inputGrid[0].length) {
14+
if (end.i >= inputGrid.length || end.j >= inputGrid[0].length) {
1515
throw new Error('Error: Endpoint outside grid bounds');
1616
}
1717

0 commit comments

Comments
 (0)