diff --git a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp index 04ac2da358..3a02c11aa9 100644 --- a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp +++ b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp @@ -14,9 +14,9 @@ namespace Web::Crypto { -JS::NonnullGCPtr Crypto::create(JS::Realm& realm) +WebIDL::ExceptionOr> Crypto::create(JS::Realm& realm) { - return realm.heap().allocate(realm, realm).release_allocated_value_but_fixme_should_propagate_errors(); + return MUST_OR_THROW_OOM(realm.heap().allocate(realm, realm)); } Crypto::Crypto(JS::Realm& realm) diff --git a/Userland/Libraries/LibWeb/Crypto/Crypto.h b/Userland/Libraries/LibWeb/Crypto/Crypto.h index 2573bbb344..7811736aaa 100644 --- a/Userland/Libraries/LibWeb/Crypto/Crypto.h +++ b/Userland/Libraries/LibWeb/Crypto/Crypto.h @@ -16,7 +16,7 @@ class Crypto : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(Crypto, Bindings::PlatformObject); public: - static JS::NonnullGCPtr create(JS::Realm&); + static WebIDL::ExceptionOr> create(JS::Realm&); virtual ~Crypto() override; diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp index 4d8f297844..df10d27f3a 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.cpp +++ b/Userland/Libraries/LibWeb/HTML/Window.cpp @@ -1067,7 +1067,7 @@ void Window::initialize_web_interfaces(Badge) Object::set_prototype(&Bindings::ensure_web_prototype(realm, "Window")); - m_crypto = Crypto::Crypto::create(realm); + m_crypto = Crypto::Crypto::create(realm).release_value_but_fixme_should_propagate_errors(); // FIXME: These should be native accessors, not properties define_native_accessor(realm, "top", top_getter, nullptr, JS::Attribute::Enumerable);