LibWeb: Skip non-font files when looking for fonts instead of asserting

This commit is contained in:
Tibor Nagy 2020-03-11 18:22:25 +01:00 committed by Andreas Kling
parent 6c32882f05
commit 39a843470c
Notes: sideshowbarker 2024-07-19 08:46:12 +09:00

View file

@ -114,7 +114,9 @@ void StyleProperties::load_font() const
Core::DirIterator it { "/res/fonts/", Core::DirIterator::Flags::SkipDots };
while (it.has_next()) {
String name = it.next_path();
ASSERT(name.ends_with(".font"));
if (!name.ends_with(".font"))
continue;
if (!name.starts_with(expected_name))
continue;