提交 40882b06 编写于 作者: B Benjamin Pasero

fix npe in DOM

上级 e2d234e6
......@@ -1085,13 +1085,13 @@ export function hide(...elements: HTMLElement[]): void {
}
}
function findParentWithAttribute(node: HTMLElement, attribute: string): HTMLElement {
function findParentWithAttribute(node: Node, attribute: string): HTMLElement {
while (node) {
if (node.hasAttribute(attribute)) {
if (node instanceof HTMLElement && node.hasAttribute(attribute)) {
return node;
}
node = <HTMLElement>node.parentNode;
node = node.parentNode;
}
return null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册