summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h')
-rw-r--r--Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h
index b51d36d387..53c4d89484 100644
--- a/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h
+++ b/Userland/Libraries/LibWeb/CSS/StyleValues/ImageStyleValue.h
@@ -20,7 +20,10 @@ class ImageStyleValue final
: public AbstractImageStyleValue
, public ImageResourceClient {
public:
- static ValueComparingNonnullRefPtr<ImageStyleValue> create(AK::URL const& url) { return adopt_ref(*new ImageStyleValue(url)); }
+ static ErrorOr<ValueComparingNonnullRefPtr<ImageStyleValue>> create(AK::URL const& url)
+ {
+ return adopt_nonnull_ref_or_enomem(new (nothrow) ImageStyleValue(url));
+ }
virtual ~ImageStyleValue() override = default;
virtual ErrorOr<String> to_string() const override;