Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Step printer crashes when next volume is undefined #1236

Closed
EinarElen opened this issue Nov 23, 2023 · 1 comment · Fixed by #1273
Closed

Step printer crashes when next volume is undefined #1236

EinarElen opened this issue Nov 23, 2023 · 1 comment · Fixed by #1273

Comments

@EinarElen
Copy link
Contributor

The step printer code assumes that the track has both a current and a next volume. When this isn't the case, we get a nullpointer dereference

@EinarElen
Copy link
Contributor Author

This happens if you are looking at a particle that is in the World_PV. The fix is trivial

// Before 
  auto nextVolume{track->GetNextVolume()->GetName()};
  // After (or something similar)
  auto nextVolumePtr{track->GetNextVolume()};
  auto nextVolume{nextVolumePtr ? nextVolumePtr->GetName() : "undefined"};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant