Skip to content

Commit

Permalink
fix(intersection): guard invalid access (autowarefoundation#4655)
Browse files Browse the repository at this point in the history
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
  • Loading branch information
satoshi-ota authored Aug 17, 2023
1 parent bb14a40 commit 81a1e53
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1130,6 +1130,10 @@ bool IntersectionModule::checkCollision(
const auto trimmed_ego_polygon =
getPolygonFromArcLength(ego_lane_with_next_lanes, start_arc_length, end_arc_length);

if (trimmed_ego_polygon.empty()) {
continue;
}

Polygon2d polygon{};
for (const auto & p : trimmed_ego_polygon) {
polygon.outer().emplace_back(p.x(), p.y());
Expand Down

0 comments on commit 81a1e53

Please sign in to comment.