зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1224941 Don't crash during ServiceWorker life cycle event dispatch if window is gone. r=baku
This commit is contained in:
Родитель
fc98aae16c
Коммит
513538cf2c
|
@ -3573,8 +3573,17 @@ FireControllerChangeOnDocument(nsIDocument* aDocument)
|
|||
MOZ_ASSERT(aDocument);
|
||||
|
||||
nsCOMPtr<nsPIDOMWindow> w = aDocument->GetWindow();
|
||||
MOZ_ASSERT(w);
|
||||
if (!w) {
|
||||
NS_WARNING("Failed to dispatch controllerchange event");
|
||||
return;
|
||||
}
|
||||
|
||||
w = w->GetCurrentInnerWindow();
|
||||
if (!w) {
|
||||
NS_WARNING("Failed to dispatch controllerchange event");
|
||||
return;
|
||||
}
|
||||
|
||||
auto* window = static_cast<nsGlobalWindow*>(w.get());
|
||||
|
||||
ErrorResult result;
|
||||
|
|
Загрузка…
Ссылка в новой задаче