diff --git a/bmad/code/create_element_slice.f90 b/bmad/code/create_element_slice.f90 index 3f12927c6c..13bbc2fb6e 100644 --- a/bmad/code/create_element_slice.f90 +++ b/bmad/code/create_element_slice.f90 @@ -141,7 +141,7 @@ recursive subroutine create_element_slice (sliced_ele, ele_in, l_slice, offset, (ele_in%tracking_method == bmad_standard$ .or. ele_in%field_calc == bmad_standard$)) then select case (ele_in%key) case (sbend$, quadrupole$, sextupole$, octupole$) - sliced_ele%rad_map%stale = .false. + if (associated(sliced_ele%rad_map)) sliced_ele%rad_map%stale = .false. end select endif