From 81a1e5397c82efeee35e94bdd95224d46efaed87 Mon Sep 17 00:00:00 2001 From: Satoshi OTA <44889564+satoshi-ota@users.noreply.github.com> Date: Thu, 17 Aug 2023 19:07:00 +0900 Subject: [PATCH] fix(intersection): guard invalid access (#4655) Signed-off-by: satoshi-ota --- .../src/scene_intersection.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/planning/behavior_velocity_intersection_module/src/scene_intersection.cpp b/planning/behavior_velocity_intersection_module/src/scene_intersection.cpp index f67bf45d55d73..7f56afde2f4ea 100644 --- a/planning/behavior_velocity_intersection_module/src/scene_intersection.cpp +++ b/planning/behavior_velocity_intersection_module/src/scene_intersection.cpp @@ -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());