Test if parent is not null before testing classList
Closes #15152 (grafted from 45cf3086a1f63732e3298845a1fa183375ec76b4) --HG-- branch : 8.2
This commit is contained in:
+1
-1
@@ -96,7 +96,7 @@
|
||||
}
|
||||
parent = parent.parentElement;
|
||||
}
|
||||
if (!parent.classList.contains('modal')) {
|
||||
if (parent && !parent.classList.contains('modal')) {
|
||||
ancestors.push(window);
|
||||
}
|
||||
return ancestors;
|
||||
|
||||
Reference in New Issue
Block a user