Skip to content

Commit

Permalink
fix: Guard against null form-group around name fields in sreq view (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jennifer-richards committed Feb 21, 2023
1 parent 957f560 commit 6a3694e
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions ietf/static/js/session_details_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
});
}
}

Expand Down

0 comments on commit 6a3694e

Please sign in to comment.