From e1268854452ff34489ccd155212443400d808ec3 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Thu, 30 May 2013 14:49:13 -0700 Subject: [PATCH] Bug 877390 - Do a blind null check. r=bz Who knows why this happens, but this appears to be the culprit per crash reports. --- dom/base/nsGlobalWindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 0d796daf3f8d..771daef67674 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -7072,8 +7072,9 @@ nsGlobalWindow::FinalClose() // round-trips to the event loop before the call to ReallyCloseWindow. This // allows setTimeout handlers that are set after FinalClose() is called to // run before the window is torn down. - bool indirect = nsContentUtils::GetCurrentJSContext() == - GetContextInternal()->GetNativeContext(); + bool indirect = GetContextInternal() && // Occasionally null. See bug 877390. + (nsContentUtils::GetCurrentJSContext() == + GetContextInternal()->GetNativeContext()); if ((!indirect && nsContentUtils::IsCallerChrome()) || NS_FAILED(nsCloseEvent::PostCloseEvent(this, indirect))) { ReallyCloseWindow();