diff options
author | Tibor Nagy <xnagytibor@gmail.com> | 2020-03-11 18:18:03 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-11 21:27:03 +0100 |
commit | 6c32882f05c958576b8bd92d4eacc2dd5bc42348 (patch) | |
tree | 94f466afd1bfaa217dd4d26065e4e91f11acd3a6 /Libraries/LibGfx/Font.cpp | |
parent | cebf6a7039eb33ef4a2b8d539bb73b330ca18cd2 (diff) | |
download | serenity-6c32882f05c958576b8bd92d4eacc2dd5bc42348.zip |
LibGfx: Do not assert on failed font file loads
Return a nullptr to signal an error instead.
Diffstat (limited to 'Libraries/LibGfx/Font.cpp')
-rw-r--r-- | Libraries/LibGfx/Font.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Libraries/LibGfx/Font.cpp b/Libraries/LibGfx/Font.cpp index 409d581a3e..ebb1933ab2 100644 --- a/Libraries/LibGfx/Font.cpp +++ b/Libraries/LibGfx/Font.cpp @@ -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; } |