mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-23 16:14:23 +00:00
Userland: Use allocation-failure safe functions where it's easy
I went through all callers of adopt_own() and replaced them with try_make<>() if possible or adopt_nonnull_own_or_enomem() else in cases where it was easy (i.e. in functions already returning ErrorOr). No intended behavior change.
This commit is contained in:
committed by
Jelle Raaijmakers
parent
f698585097
commit
9cfd7a299c
@@ -24,7 +24,7 @@ ErrorOr<NonnullOwnPtr<ProjectConfig>> ProjectConfig::try_load_project_config(Dep
|
||||
if (!json.is_object())
|
||||
return Error::from_string_literal("The topmost JSON element is not an object");
|
||||
|
||||
return adopt_own(*new ProjectConfig(json.as_object()));
|
||||
return try_make<ProjectConfig>(json.as_object());
|
||||
}
|
||||
|
||||
NonnullOwnPtr<ProjectConfig> ProjectConfig::create_empty()
|
||||
|
||||
Reference in New Issue
Block a user