summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.h
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2023-05-05 15:02:03 +0100
committerAndreas Kling <kling@serenityos.org>2023-05-06 08:07:28 +0200
commitd16600a48ba2c267387335839969462a1f424339 (patch)
treefa62562e3fcd8ae6338c6cd2387946c6a06b743c /Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.h
parent36bb04d7926929e804aa15dcf90695f453b78269 (diff)
downloadserenity-d16600a48ba2c267387335839969462a1f424339.zip
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.h')
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleValues/RadialGradientStyleValue.h4
1 files changed, 2 insertions, 2 deletions
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<Extent, CircleSize, EllipseSize>;
- static ValueComparingNonnullRefPtr<RadialGradientStyleValue> create(EndingShape ending_shape, Size size, PositionValue position, Vector<LinearColorStopListElement> color_stop_list, GradientRepeating repeating)
+ static ErrorOr<ValueComparingNonnullRefPtr<RadialGradientStyleValue>> create(EndingShape ending_shape, Size size, PositionValue position, Vector<LinearColorStopListElement> 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<String> to_string() const override;