diff options
author | Andreas Kling <kling@serenityos.org> | 2021-10-09 16:34:28 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-10-09 16:35:25 +0200 |
commit | 3b0da8b28c35cedaaccf68adfad0d3344c10877a (patch) | |
tree | b626e2622ee85edf2bc4131fbffe20d0254c11bb /Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | |
parent | 9d352c602cc61a0e7ef3d11039b32a59a5550104 (diff) | |
download | serenity-3b0da8b28c35cedaaccf68adfad0d3344c10877a.zip |
LibWeb: Add a missing null check in StyleComputer::compute_font()
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/StyleComputer.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleComputer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp index eb3ca4eafd..40d7ef3e8e 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -708,7 +708,7 @@ void StyleComputer::compute_font(StyleProperties& style, DOM::Element const* ele float root_font_size = 10; Gfx::FontMetrics font_metrics; - if (element && element->parent_element()) + if (element && element->parent_element() && element->parent_element()->specified_css_values()) font_metrics = element->parent_element()->specified_css_values()->computed_font().metrics('M'); else font_metrics = Gfx::FontDatabase::default_font().metrics('M'); |