Skip to content

Commit

Permalink
fix(intersection): fixed bad optional access (autowarefoundation#3712) (
Browse files Browse the repository at this point in the history
autowarefoundation#477)

Signed-off-by: Mamoru Sobue <[email protected]>
  • Loading branch information
soblin authored and kyoichi-sugahara committed May 16, 2023
1 parent 9151264 commit e99f5d7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,10 @@ bool IntersectionModule::modifyPathVelocity(PathWithLaneId * path, StopReason *
stop_line_idx = occlusion_first_stop_line_idx;
// insert creep velocity [default_stop_line, occlusion_stop_line)
insert_creep_during_occlusion =
std::make_pair(default_stop_line_idx_opt.value(), occlusion_peeking_line_idx_opt.value());
default_stop_line_idx_opt && occlusion_peeking_line_idx_opt
? std::make_optional<std::pair<size_t, size_t>>(
default_stop_line_idx_opt.value(), occlusion_peeking_line_idx_opt.value())
: std::nullopt;
occlusion_state_ = OcclusionState::BEFORE_FIRST_STOP_LINE;
}
} else if (occlusion_state_ != OcclusionState::CLEARED) {
Expand Down

0 comments on commit e99f5d7

Please sign in to comment.