commit 6f8fbe841ac3f16980a743e8073b91e0e9ec7741
parent 9f658bb63622c579ebd7e1107076fb5ff3f3de76
Author: moz-mdauer <mdauer@mozilla.com>
Date: Mon, 3 Nov 2025 10:29:31 +0000
Bug 1997639 - Set error on early returns, r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D270900
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/dom/webtransport/api/WebTransport.cpp b/dom/webtransport/api/WebTransport.cpp
@@ -277,6 +277,7 @@ void WebTransport::Init(const GlobalObject& aGlobal, const nsAString& aURL,
PBackgroundChild* backgroundChild =
BackgroundChild::GetOrCreateForCurrentThread();
if (NS_WARN_IF(!backgroundChild)) {
+ aError.Throw(NS_ERROR_FAILURE);
return;
}
@@ -295,9 +296,11 @@ void WebTransport::Init(const GlobalObject& aGlobal, const nsAString& aURL,
RefPtr<WebTransportChild> child = new WebTransportChild(this);
if (NS_IsMainThread()) {
if (!childEndpoint.Bind(child)) {
+ aError.Throw(NS_ERROR_FAILURE);
return;
}
} else if (!childEndpoint.Bind(child, mGlobal->SerialEventTarget())) {
+ aError.Throw(NS_ERROR_FAILURE);
return;
}