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
Notes:
sideshowbarker
2024-07-19 08:46:16 +09:00
Author: https://github.com/xTibor Commit: https://github.com/SerenityOS/serenity/commit/6c32882f05c Pull-request: https://github.com/SerenityOS/serenity/pull/1417
1 changed files with 3 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue