Skip to content

Commit

Permalink
Prevent invalid accesses on paths in path_longer_on_approach (#4375)
Browse files Browse the repository at this point in the history
* Prevent invalid accesses on paths in path_longer_on_approach

* Fix format of the change
  • Loading branch information
lss0815 authored May 29, 2024
1 parent e8d3cd8 commit 1f26900
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ inline BT::NodeStatus PathLongerOnApproach::tick()
getInput("length_factor", length_factor_);

if (first_time_ == false) {
if (old_path_.poses.back() != new_path_.poses.back()) {
if (old_path_.poses.empty() || new_path_.poses.empty() ||
old_path_.poses.back() != new_path_.poses.back())
{
first_time_ = true;
}
}
Expand Down

0 comments on commit 1f26900

Please sign in to comment.