summaryrefslogtreecommitdiffhomepage
path: root/src/search-astar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/search-astar.cpp')
-rw-r--r--src/search-astar.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/search-astar.cpp b/src/search-astar.cpp
index e86e6bee..77239669 100644
--- a/src/search-astar.cpp
+++ b/src/search-astar.cpp
@@ -135,6 +135,9 @@ void set_result_from_idx(path_search_result& result,
for (auto i = idx; i != (uint32_t)-1; i = nodes[i].prev)
len++;
+ if (!len) [[unlikely]]
+ return;
+
fm_debug_assert(idx != (uint32_t)-1);
arrayResize(temp_nodes, 0);
arrayReserve(temp_nodes, len+1);