Access element subshell map data only if it has atomic relaxation data (#4020)

This commit is contained in:
GuySten 2026-07-17 15:40:16 +03:00 committed by GitHub
parent f1fb6721f0
commit d3bc1669d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -359,8 +359,8 @@ void sample_photon_reaction(Particle& p)
// Allow electrons to fill orbital and produce Auger electrons and
// fluorescent photons. Since Compton subshell data does not match atomic
// relaxation data, use the mapping between the data to find the subshell
if (settings::atomic_relaxation && i_shell >= 0 &&
element.subshell_map_[i_shell] >= 0) {
if (settings::atomic_relaxation && element.has_atomic_relaxation_ &&
i_shell >= 0 && element.subshell_map_[i_shell] >= 0) {
element.atomic_relaxation(element.subshell_map_[i_shell], p);
}