mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:37:45 +00:00
LibGfx: Use ErrorOr<T> for Bitmap::try_load_from_file()
This was used in a lot of places, so this patch makes liberal use of ErrorOr<T>::release_value_but_fixme_should_propagate_errors().
This commit is contained in:
parent
16f064d9be
commit
235f39e449
104 changed files with 412 additions and 397 deletions
|
@ -19,12 +19,12 @@ const Bitmap* Emoji::emoji_for_code_point(u32 code_point)
|
|||
if (it != s_emojis.end())
|
||||
return (*it).value.ptr();
|
||||
|
||||
auto bitmap = Bitmap::try_load_from_file(String::formatted("/res/emoji/U+{:X}.png", code_point));
|
||||
if (!bitmap) {
|
||||
auto bitmap_or_error = Bitmap::try_load_from_file(String::formatted("/res/emoji/U+{:X}.png", code_point));
|
||||
if (bitmap_or_error.is_error()) {
|
||||
s_emojis.set(code_point, nullptr);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto bitmap = bitmap_or_error.release_value();
|
||||
s_emojis.set(code_point, bitmap);
|
||||
return bitmap.ptr();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue