mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:27:45 +00:00
LibGfx: Do not assert on failed font file loads
Return a nullptr to signal an error instead.
This commit is contained in:
parent
cebf6a7039
commit
6c32882f05
1 changed files with 3 additions and 0 deletions
|
@ -178,6 +178,9 @@ RefPtr<Font> Font::load_from_file(const StringView& path)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
auto font = load_from_memory((const u8*)mapped_file.data());
|
auto font = load_from_memory((const u8*)mapped_file.data());
|
||||||
|
if (!font)
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
font->m_mapped_file = move(mapped_file);
|
font->m_mapped_file = move(mapped_file);
|
||||||
return font;
|
return font;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue