diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/StyleValues/NumericStyleValue.h')
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleValues/NumericStyleValue.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/NumericStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/NumericStyleValue.h index 268b91eddc..59e6b86063 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValues/NumericStyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValues/NumericStyleValue.h @@ -15,14 +15,14 @@ namespace Web::CSS { class NumericStyleValue : public StyleValueWithDefaultOperators<NumericStyleValue> { public: - static ValueComparingNonnullRefPtr<NumericStyleValue> create_float(float value) + static ErrorOr<ValueComparingNonnullRefPtr<NumericStyleValue>> create_float(float value) { - return adopt_ref(*new NumericStyleValue(value)); + return adopt_nonnull_ref_or_enomem(new (nothrow) NumericStyleValue(value)); } - static ValueComparingNonnullRefPtr<NumericStyleValue> create_integer(i64 value) + static ErrorOr<ValueComparingNonnullRefPtr<NumericStyleValue>> create_integer(i64 value) { - return adopt_ref(*new NumericStyleValue(value)); + return adopt_nonnull_ref_or_enomem(new (nothrow) NumericStyleValue(value)); } virtual bool has_length() const override { return to_number() == 0; } |