Bugfix: fix crash in some circumstances caused by Avoid crossing perimeters. #2271

This commit is contained in:
Alessandro Ranellucci 2014-09-23 20:19:47 +02:00
parent 24d67c42c6
commit 6573ae002a
3 changed files with 9 additions and 3 deletions

View file

@ -226,6 +226,9 @@ MotionPlannerGraph::find_node(const Point &point) const
void
MotionPlannerGraph::shortest_path(size_t from, size_t to, Polyline* polyline)
{
// this prevents a crash in case for some reason we got here with an empty adjacency list
if (this->adjacency_list.empty()) return;
const weight_t max_weight = std::numeric_limits<weight_t>::infinity();
std::vector<weight_t> min_distance;