summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Crypto/Crypto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb/Crypto/Crypto.cpp')
-rw-r--r--Userland/Libraries/LibWeb/Crypto/Crypto.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp
index 3a02c11aa9..7797876daf 100644
--- a/Userland/Libraries/LibWeb/Crypto/Crypto.cpp
+++ b/Userland/Libraries/LibWeb/Crypto/Crypto.cpp
@@ -8,6 +8,7 @@
#include <AK/Random.h>
#include <AK/StringBuilder.h>
#include <LibJS/Runtime/TypedArray.h>
+#include <LibWeb/Bindings/ExceptionOrUtils.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/Crypto/Crypto.h>
#include <LibWeb/Crypto/SubtleCrypto.h>
@@ -30,7 +31,9 @@ JS::ThrowCompletionOr<void> Crypto::initialize(JS::Realm& realm)
{
MUST_OR_THROW_OOM(Base::initialize(realm));
set_prototype(&Bindings::ensure_web_prototype<Bindings::CryptoPrototype>(realm, "Crypto"));
- m_subtle = SubtleCrypto::create(realm);
+ m_subtle = TRY(Bindings::throw_dom_exception_if_needed(realm.vm(), [&]() {
+ return SubtleCrypto::create(realm);
+ }));
return {};
}