From 36c145b197b0e72b1f6eeac289471641a52a559e Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Thu, 4 Jan 2024 12:31:29 +1300 Subject: [PATCH] LibWeb: Fix crash in DOMImplementation.createDocument for null namespace We were blindly assuming that the namespace was non-null instead of simply passing it through. --- Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp index 202881a57e..d5a0445db4 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMImplementation.cpp @@ -58,7 +58,7 @@ WebIDL::ExceptionOr> DOMImplementation::create_docume // 3. If qualifiedName is not the empty string, then set element to the result of running the internal createElementNS steps, given document, namespace, qualifiedName, and an empty dictionary. if (!qualified_name.is_empty()) - element = TRY(xml_document->create_element_ns(namespace_.value(), qualified_name, ElementCreationOptions {})); + element = TRY(xml_document->create_element_ns(namespace_, qualified_name, ElementCreationOptions {})); // 4. If doctype is non-null, append doctype to document. if (doctype)