Skip to content

Commit

Permalink
fix: Check Navigator start surface not null
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed May 15, 2024
1 parent 592e1f2 commit 915a22f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Core/include/Acts/Propagator/Navigator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ class Navigator {
: m_cfg{std::move(cfg)}, m_logger{std::move(_logger)} {}

State makeState(const Options& options) const {
assert(options.startSurface != nullptr && "Start surface must be set");

State state;
state.options = options;
return state;
Expand Down Expand Up @@ -1023,12 +1025,14 @@ class Navigator {
bool resolveSurfaces(propagator_state_t& state, const stepper_t& stepper,
const Layer* cLayer = nullptr) const {
// get the layer and layer surface
auto layerSurface = cLayer ? state.navigation.startSurface
: state.navigation.navLayer().first.object();
auto navLayer = cLayer ? cLayer : state.navigation.navLayer().second;
const Layer* navLayer =
cLayer ? cLayer : state.navigation.navLayer().second;
assert(navLayer != nullptr && "Current layer is not set.");
const Surface* layerSurface = &navLayer->surfaceRepresentation();
// are we on the start layer
bool onStart = (navLayer == state.navigation.startLayer);
auto startSurface = onStart ? state.navigation.startSurface : layerSurface;
const Surface* startSurface = (navLayer == state.navigation.startLayer)
? state.navigation.startSurface
: layerSurface;
// Use navigation parameters and NavigationOptions
NavigationOptions<Surface> navOpts;
navOpts.resolveSensitive = m_cfg.resolveSensitive;
Expand Down

0 comments on commit 915a22f

Please sign in to comment.