diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index 14827158f53e9..c297fddbb474a 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -370,7 +370,8 @@ void TabParent::AddWindowListeners() { } void TabParent::RemoveWindowListeners() { - if (mFrameElement && mFrameElement->OwnerDoc()->GetWindow()) { + if (mFrameElement && mFrameElement->OwnerDoc() && + mFrameElement->OwnerDoc()->GetWindow()) { nsCOMPtr window = mFrameElement->OwnerDoc()->GetWindow(); nsCOMPtr eventTarget = window->GetTopWindowRoot();