From 55f17002136b7e8327e12bc9452490697bd28601 Mon Sep 17 00:00:00 2001 From: Neil Deakin Date: Thu, 27 Nov 2014 08:27:39 -0500 Subject: [PATCH] Bug 1072342, the child process doesn't have a main widget, r=smaug --- dom/base/nsGlobalWindow.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 49967ff637a5..2ac428660b0d 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -9824,14 +9824,14 @@ nsGlobalWindow::ActivateOrDeactivate(bool aActivate) // Set / unset mIsActive on the top level window, which is used for the // :-moz-window-inactive pseudoclass, and its sheet (if any). nsCOMPtr mainWidget = GetMainWidget(); - if (!mainWidget) - return; - - // Get the top level widget (if the main widget is a sheet, this will - // be the sheet's top (non-sheet) parent). - nsCOMPtr topLevelWidget = mainWidget->GetSheetWindowParent(); - if (!topLevelWidget) { - topLevelWidget = mainWidget; + nsCOMPtr topLevelWidget; + if (mainWidget) { + // Get the top level widget (if the main widget is a sheet, this will + // be the sheet's top (non-sheet) parent). + topLevelWidget = mainWidget->GetSheetWindowParent(); + if (!topLevelWidget) { + topLevelWidget = mainWidget; + } } nsCOMPtr piMainWindow(