diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 53957c12b7..f6b3f7e3fc 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -2058,7 +2058,7 @@ CSS::StyleSheetList const& Document::style_sheets() const JS::NonnullGCPtr Document::history() { if (!m_history) - m_history = HTML::History::create(realm(), *this); + m_history = HTML::History::create(realm(), *this).release_value_but_fixme_should_propagate_errors(); return *m_history; } diff --git a/Userland/Libraries/LibWeb/HTML/History.cpp b/Userland/Libraries/LibWeb/HTML/History.cpp index 9d30f7e226..ac3e13f1ce 100644 --- a/Userland/Libraries/LibWeb/HTML/History.cpp +++ b/Userland/Libraries/LibWeb/HTML/History.cpp @@ -10,9 +10,9 @@ namespace Web::HTML { -JS::NonnullGCPtr History::create(JS::Realm& realm, DOM::Document& document) +WebIDL::ExceptionOr> History::create(JS::Realm& realm, DOM::Document& document) { - return realm.heap().allocate(realm, realm, document).release_allocated_value_but_fixme_should_propagate_errors(); + return MUST_OR_THROW_OOM(realm.heap().allocate(realm, realm, document)); } History::History(JS::Realm& realm, DOM::Document& document) diff --git a/Userland/Libraries/LibWeb/HTML/History.h b/Userland/Libraries/LibWeb/HTML/History.h index 044d947adc..aad9574912 100644 --- a/Userland/Libraries/LibWeb/HTML/History.h +++ b/Userland/Libraries/LibWeb/HTML/History.h @@ -16,7 +16,7 @@ class History final : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(History, Bindings::PlatformObject); public: - static JS::NonnullGCPtr create(JS::Realm&, DOM::Document&); + static WebIDL::ExceptionOr> create(JS::Realm&, DOM::Document&); virtual ~History() override;