Skip to content

Commit

Permalink
Merge pull request #189 from gonzaponte/segfault-steppingaction
Browse files Browse the repository at this point in the history
Fix segfault in SaveAllSteppingAction
  • Loading branch information
paolafer authored Nov 25, 2022
2 parents 1aa0de4 + bf27530 commit c874449
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/actions/SaveAllSteppingAction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ void SaveAllSteppingAction::UserSteppingAction(const G4Step* step)
G4ThreeVector initial_pos = pre ->GetPosition();
G4ThreeVector final_pos = post->GetPosition();

if (! post->GetTouchableHandle()->GetVolume()) return; // Particle exits the world

G4String initial_volume = pre ->GetTouchableHandle()->GetVolume()->GetName();
G4String final_volume = post->GetTouchableHandle()->GetVolume()->GetName();
G4String proc_name = post->GetProcessDefinedStep()->GetProcessName();
Expand Down

0 comments on commit c874449

Please sign in to comment.