Bug 877390 - Do a blind null check. r=bz

Who knows why this happens, but this appears to be the culprit per crash
reports.
This commit is contained in:
Bobby Holley 2013-05-30 14:49:13 -07:00
Родитель dca1b89519
Коммит e126885445
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -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();