From d16600a48ba2c267387335839969462a1f424339 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Fri, 5 May 2023 15:02:03 +0100 Subject: LibWeb: Propagate errors from StyleValue construction Turns out we create a lot of these, mostly from places that don't return ErrorOr. The yak stack grows. --- Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.h') diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.h index aae9e8c864..96aec112a1 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.h @@ -44,10 +44,10 @@ public: using Size = Variant; - static ValueComparingNonnullRefPtr create(EndingShape ending_shape, Size size, PositionValue position, Vector color_stop_list, GradientRepeating repeating) + static ErrorOr> create(EndingShape ending_shape, Size size, PositionValue position, Vector color_stop_list, GradientRepeating repeating) { VERIFY(color_stop_list.size() >= 2); - return adopt_ref(*new RadialGradientStyleValue(ending_shape, size, position, move(color_stop_list), repeating)); + return adopt_nonnull_ref_or_enomem(new (nothrow) RadialGradientStyleValue(ending_shape, size, position, move(color_stop_list), repeating)); } virtual ErrorOr to_string() const override; -- cgit v1.2.3