MDL-77241 course: optional chaining safety for section toggles.

This commit is contained in:
Paul Holden
2023-02-14 13:15:40 +00:00
parent 44d77d0848
commit 3fced488b3
3 changed files with 3 additions and 3 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -161,7 +161,7 @@ export default class Component extends BaseComponent {
const closestCollapse = event.target.closest(this.selectors.COLLAPSE);
// Assume that chevron is the only collapse toggler in a section heading;
// I think this is the most efficient way to verify at the moment.
const isChevron = closestCollapse.closest(this.selectors.SECTION_ITEM);
const isChevron = closestCollapse?.closest(this.selectors.SECTION_ITEM);
if (sectionlink || isChevron) {