diff --git a/dom/workers/ServiceWorkerClient.cpp b/dom/workers/ServiceWorkerClient.cpp index f4f6958b6970..cb101513de6b 100644 --- a/dom/workers/ServiceWorkerClient.cpp +++ b/dom/workers/ServiceWorkerClient.cpp @@ -35,6 +35,7 @@ NS_INTERFACE_MAP_END ServiceWorkerClientInfo::ServiceWorkerClientInfo(nsIDocument* aDoc) : mWindowId(0) + , mFrameType(FrameType::None) { MOZ_ASSERT(aDoc); nsresult rv = aDoc->GetOrCreateId(mClientId); @@ -64,8 +65,9 @@ ServiceWorkerClientInfo::ServiceWorkerClientInfo(nsIDocument* aDoc) } RefPtr outerWindow = nsGlobalWindow::Cast(aDoc->GetWindow()); - MOZ_ASSERT(outerWindow); - if (!outerWindow->IsTopLevelWindow()) { + if (!outerWindow) { + MOZ_ASSERT(mFrameType == FrameType::None); + } else if (!outerWindow->IsTopLevelWindow()) { mFrameType = FrameType::Nested; } else if (outerWindow->HadOriginalOpener()) { mFrameType = FrameType::Auxiliary;