diff --git a/ietf/static/js/session_details_form.js b/ietf/static/js/session_details_form.js index 84dbc51736..29b481999f 100644 --- a/ietf/static/js/session_details_form.js +++ b/ietf/static/js/session_details_form.js @@ -55,9 +55,19 @@ function update_name_field_visibility(name_elts, purpose) { if (!purpose || purpose === 'regular') { - name_elts.forEach(e => e.closest('.form-group').classList.add('hidden')); + name_elts.forEach(e => { + const formGroup = e.closest('.form-group'); + if (formGroup) { + formGroup.classList.add('hidden'); + } + }); } else { - name_elts.forEach(e => e.closest('.form-group').classList.remove('hidden')); + name_elts.forEach(e => { + const formGroup = e.closest('.form-group'); + if (formGroup) { + formGroup.classList.remove('hidden'); + } + }); } }