Added check if there is no parent element
parent
26a9cb67d8
commit
017408c8f5
|
@ -119,6 +119,8 @@
|
|||
return currentElement;
|
||||
}
|
||||
currentElement = currentElement.parentElement;
|
||||
if (currentElement === null) // if there is no parent element
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue