1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 10:08:10 +00:00

LibWeb: Don't crash in BrowsingContextContainer::content_document()

Instead of choking on the VERIFY(document), let's just return null if
there's no active document for now. This is incorrect, but sidesteps
a frequent crash that happens on content with iframes.

I've left a FIXME about removing the hack once it's no longer needed.
This commit is contained in:
Andreas Kling 2022-03-20 18:41:03 +01:00
parent d03680a9e7
commit 6ac3bf2982

View file

@ -55,6 +55,10 @@ const DOM::Document* BrowsingContextContainer::content_document() const
// 3. Let document be context's active document.
auto const* document = context.active_document();
//FIXME: This should not be here, as we're expected to have a document at this point.
if (!document)
return nullptr;
VERIFY(document);
VERIFY(m_document);