mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:48:11 +00:00
LibWeb: Protect against null deref during Web::Page initialization
BrowsingContext::set_active_document() may end up asking for the Page's top level browsing context before Page has one. Do a workaround for now where we have an API to ask if it's initialized. Long-term we should find a cleaner solution.
This commit is contained in:
parent
f07ac8f20a
commit
33500bb6db
3 changed files with 9 additions and 1 deletions
|
@ -532,7 +532,7 @@ void BrowsingContext::set_active_document(JS::NonnullGCPtr<DOM::Document> docume
|
|||
// AD-HOC:
|
||||
document->set_browsing_context(this);
|
||||
|
||||
if (m_page && this == &m_page->top_level_browsing_context())
|
||||
if (m_page && m_page->top_level_browsing_context_is_initialized() && this == &m_page->top_level_browsing_context())
|
||||
m_page->client().page_did_change_title(document->title());
|
||||
|
||||
if (previously_active_document && previously_active_document != document.ptr())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue