mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
LibWeb: Don't crash when detached document tries to use system palette
If the current Document is not attached to a Web::Page for whatever reason, but we're trying to look up a color from the system palette, let's just fail the lookup instead of crashing the process.
This commit is contained in:
parent
aa45cdf71d
commit
f87edd4c14
1 changed files with 3 additions and 1 deletions
|
@ -1121,7 +1121,9 @@ Color IdentifierStyleValue::to_color(Layout::NodeWithStyle const& node) const
|
|||
if (id() == CSS::ValueID::LibwebLink)
|
||||
return document.link_color();
|
||||
|
||||
VERIFY(document.page());
|
||||
if (!document.page())
|
||||
return {};
|
||||
|
||||
auto palette = document.page()->palette();
|
||||
switch (id()) {
|
||||
case CSS::ValueID::LibwebPaletteDesktopBackground:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue