diff --git a/dom/workers/ServiceWorkerManager.cpp b/dom/workers/ServiceWorkerManager.cpp index 347db83201f4..2503caac6d74 100644 --- a/dom/workers/ServiceWorkerManager.cpp +++ b/dom/workers/ServiceWorkerManager.cpp @@ -2361,7 +2361,10 @@ ServiceWorkerManager::IsControlled(nsIDocument* aDoc, bool* aIsControlled) MOZ_ASSERT(aIsControlled); nsRefPtr registration; nsresult rv = GetDocumentRegistration(aDoc, getter_AddRefs(registration)); - NS_ENSURE_SUCCESS(rv, rv); + if (NS_WARN_IF(NS_FAILED(rv) && rv != NS_ERROR_NOT_AVAILABLE)) { + // It's OK to ignore the case where we don't have a registration. + return rv; + } *aIsControlled = !!registration; return NS_OK; } @@ -2372,7 +2375,7 @@ ServiceWorkerManager::GetDocumentRegistration(nsIDocument* aDoc, { nsRefPtr registration; if (!mControlledDocuments.Get(aDoc, getter_AddRefs(registration))) { - return NS_ERROR_FAILURE; + return NS_ERROR_NOT_AVAILABLE; } // If the document is controlled, the current worker MUST be non-null.