mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 831472 - Add another null check to nsGlobalWindow::GetInnerScreenRect(). r=smaug
This commit is contained in:
parent
190d56fcd0
commit
5121706d6d
@ -3874,8 +3874,9 @@ nsGlobalWindow::GetScreenX(int32_t* aScreenX)
|
||||
nsRect
|
||||
nsGlobalWindow::GetInnerScreenRect()
|
||||
{
|
||||
if (!mDocShell)
|
||||
if (!mDocShell) {
|
||||
return nsRect();
|
||||
}
|
||||
|
||||
nsGlobalWindow* rootWindow =
|
||||
static_cast<nsGlobalWindow*>(GetPrivateRoot());
|
||||
@ -3883,12 +3884,18 @@ nsGlobalWindow::GetInnerScreenRect()
|
||||
rootWindow->FlushPendingNotifications(Flush_Layout);
|
||||
}
|
||||
|
||||
if (!mDocShell) {
|
||||
return nsRect();
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPresShell> presShell = mDocShell->GetPresShell();
|
||||
if (!presShell)
|
||||
if (!presShell) {
|
||||
return nsRect();
|
||||
}
|
||||
nsIFrame* rootFrame = presShell->GetRootFrame();
|
||||
if (!rootFrame)
|
||||
if (!rootFrame) {
|
||||
return nsRect();
|
||||
}
|
||||
|
||||
return rootFrame->GetScreenRectInAppUnits();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user