Skip to content

Commit

Permalink
fix(intersection): guard invalid access
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 committed Aug 17, 2023
1 parent b5f83d0 commit 1a8a2a8
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 1a8a2a8

Please sign in to comment.