From b587eb2f4d3c8794cf6dd68b0fa9cac65a1424bb Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 6 Oct 2019 14:57:49 +0200 Subject: [PATCH] LibHTML: Fall back to the system default font if we can't find a font Instead of crashing when we don't have some font the CSS wanted, just go with Font::default_font(). --- Libraries/LibHTML/CSS/StyleProperties.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/LibHTML/CSS/StyleProperties.cpp b/Libraries/LibHTML/CSS/StyleProperties.cpp index 56e4b2ae74..d397853491 100644 --- a/Libraries/LibHTML/CSS/StyleProperties.cpp +++ b/Libraries/LibHTML/CSS/StyleProperties.cpp @@ -81,7 +81,8 @@ void StyleProperties::load_font() const if (file_name.is_null()) { dbg() << "Failed to find a font for family " << font_family << " weight " << font_weight; - ASSERT_NOT_REACHED(); + m_font = Font::default_font(); + return; } #ifdef HTML_DEBUG