diff --git a/js/xpconnect/src/XPCWrappedJSClass.cpp b/js/xpconnect/src/XPCWrappedJSClass.cpp index f080d46115d9..0566720c2cec 100644 --- a/js/xpconnect/src/XPCWrappedJSClass.cpp +++ b/js/xpconnect/src/XPCWrappedJSClass.cpp @@ -515,6 +515,7 @@ nsXPCWrappedJSClass::DelegatedQueryInterface(nsXPCWrappedJS* self, NS_ENSURE_TRUE(nativeGlobal->GetGlobalJSObject(), NS_ERROR_FAILURE); AutoEntryScript aes(nativeGlobal, "XPCWrappedJS QueryInterface", /* aIsMainThread = */ true); + aes.TakeOwnershipOfErrorReporting(); XPCCallContext ccx(NATIVE_CALLER, aes.cx()); if (!ccx.IsValid()) { *aInstancePtr = nullptr;