LibGfx: Do not assert on failed font file loads

Return a nullptr to signal an error instead.
This commit is contained in:
Tibor Nagy 2020-03-11 18:18:03 +01:00 committed by Andreas Kling
parent cebf6a7039
commit 6c32882f05
Notes: sideshowbarker 2024-07-19 08:46:16 +09:00

View file

@ -178,6 +178,9 @@ RefPtr<Font> Font::load_from_file(const StringView& path)
return nullptr;
auto font = load_from_memory((const u8*)mapped_file.data());
if (!font)
return nullptr;
font->m_mapped_file = move(mapped_file);
return font;
}