From f6296b1cc9591a6ff6af2b2a25d4b99bdaeed790 Mon Sep 17 00:00:00 2001 From: "dbaron%dbaron.org" Date: Sat, 6 Nov 2004 07:59:46 +0000 Subject: [PATCH] Null-check for unreproducable topcrash. b=267804 r+sr=jst git-svn-id: svn://10.0.0.236/trunk@165057 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index b18b7a86384..fab4fbae155 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -3342,6 +3342,13 @@ nsDocShell::GetVisibility(PRBool * aVisibility) nsCOMPtr pPresShell; parentDS->GetPresShell(getter_AddRefs(pPresShell)); + // Null-check for crash in bug 267804 + if (!pPresShell) { + NS_NOTREACHED("docshell has null pres shell"); + *aVisibility = PR_FALSE; + return NS_OK; + } + nsIContent *shellContent = pPresShell->GetDocument()->FindContentForSubDocument(presShell->GetDocument()); NS_ASSERTION(shellContent, "subshell not in the map");