From 5121706d6dea02beface8f0210005df277a1d576 Mon Sep 17 00:00:00 2001 From: Gary Kwong Date: Wed, 16 Jan 2013 13:44:26 -0800 Subject: [PATCH] Bug 831472 - Add another null check to nsGlobalWindow::GetInnerScreenRect(). r=smaug --- dom/base/nsGlobalWindow.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index cadd8fd2afd..fbc6e733dc9 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -3874,8 +3874,9 @@ nsGlobalWindow::GetScreenX(int32_t* aScreenX) nsRect nsGlobalWindow::GetInnerScreenRect() { - if (!mDocShell) + if (!mDocShell) { return nsRect(); + } nsGlobalWindow* rootWindow = static_cast(GetPrivateRoot()); @@ -3883,12 +3884,18 @@ nsGlobalWindow::GetInnerScreenRect() rootWindow->FlushPendingNotifications(Flush_Layout); } + if (!mDocShell) { + return nsRect(); + } + nsCOMPtr presShell = mDocShell->GetPresShell(); - if (!presShell) + if (!presShell) { return nsRect(); + } nsIFrame* rootFrame = presShell->GetRootFrame(); - if (!rootFrame) + if (!rootFrame) { return nsRect(); + } return rootFrame->GetScreenRectInAppUnits(); }