mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +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
Notes:
sideshowbarker
2024-07-17 17:05:09 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f87edd4c14
|
@ -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…
Reference in a new issue