Skip to content

Commit

Permalink
LibGfx: Do not assert on failed font file loads
Browse files Browse the repository at this point in the history
Return a nullptr to signal an error instead.
  • Loading branch information
xTibor authored and awesomekling committed Mar 11, 2020
1 parent cebf6a7 commit 6c32882
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Libraries/LibGfx/Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6c32882

Please sign in to comment.