LibWeb: Add a missing null check in StyleComputer::compute_font()
This commit is contained in:
parent
9d352c602c
commit
3b0da8b28c
Notes:
sideshowbarker
2024-07-18 03:20:18 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/3b0da8b28c3
1 changed files with 1 additions and 1 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Reference in a new issue