mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:57:35 +00:00
LibWeb/CSS: Remove nullpointer dereference in Parser
On platinenmacher.tech there is a document without a window. During size attribute parsing the window pointer is dereferenced which causes a crash. This checks for the window to be actually there before dereferencing.
This commit is contained in:
parent
343d6b001f
commit
7d63b8b95f
2 changed files with 3 additions and 2 deletions
|
@ -56,7 +56,7 @@ AK::URL ParsingContext::complete_url(StringView relative_url) const
|
|||
|
||||
HTML::Window const* ParsingContext::window() const
|
||||
{
|
||||
return m_document ? &m_document->window() : nullptr;
|
||||
return m_document && m_document->default_view() ? &m_document->window() : nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue