chore(types): add null checks (#16351)

This commit is contained in:
Adam Bradley
2018-11-16 22:20:51 -06:00
committed by GitHub
parent 2e8f15af18
commit 8cb266ba34
5 changed files with 10 additions and 8 deletions

View File

@ -124,7 +124,7 @@ export function doRender(
function createNode(el: HTMLElement, type: CellType): HTMLElement | null {
const template = getTemplate(el, type);
if (template) {
if (template && el.ownerDocument) {
return el.ownerDocument.importNode(template.content, true).children[0] as HTMLElement;
}
return null;