1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:17:46 +00:00

AK: Make Error and ErrorOr<T> work in Lagom as well :^)

ErrnoCode is not a thing outside __serenity__, so let's not make
assumptions about it existing.
This commit is contained in:
Andreas Kling 2021-11-06 22:16:50 +01:00
parent 6e255b262f
commit 202950bb01
2 changed files with 5 additions and 3 deletions

View file

@ -353,7 +353,7 @@ inline ErrorOr<NonnullRefPtr<T>> adopt_nonnull_ref_or_enomem(T* object)
{
auto result = adopt_ref_if_nonnull(object);
if (!result)
return ENOMEM;
return Error::from_errno(ENOMEM);
return result.release_nonnull();
}