From 4c0377add9735c5142b1b09a75579cf98ad16665 Mon Sep 17 00:00:00 2001 From: David Sancho Date: Mon, 29 Jul 2024 13:10:15 +0200 Subject: [PATCH] Update Webapi__Dom__Document.re --- src/Webapi/Dom/Webapi__Dom__Document.re | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Webapi/Dom/Webapi__Dom__Document.re b/src/Webapi/Dom/Webapi__Dom__Document.re index 5816956..716b4db 100644 --- a/src/Webapi/Dom/Webapi__Dom__Document.re +++ b/src/Webapi/Dom/Webapi__Dom__Document.re @@ -6,7 +6,11 @@ module Impl = (T: { let asHtmlDocument: T.t => Js.null(Dom.htmlDocument) = [%raw {| function (document) { - return document.doctype.name === "html" ? document : null; + if (document.doctype) { + return document.doctype.name === "html" ? document : null; + } else { + return null + } } |} ];