1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:27:43 +00:00

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.
This commit is contained in:
Shannon Booth 2024-01-04 12:31:29 +13:00 committed by Andreas Kling
parent a028c87069
commit 36c145b197

View file

@ -58,7 +58,7 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<Document>> 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)