1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 10:27:35 +00:00

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

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;
}