From 21a67525e5238ed443cb748dc2f4e04c14ef1abb Mon Sep 17 00:00:00 2001 From: "heikki%netscape.com" Date: Sat, 29 Sep 2001 00:30:03 +0000 Subject: [PATCH] Bug 101429, bad argument to function, fixes assertion and potential crash. r=harishd, sr=hewitt. git-svn-id: svn://10.0.0.236/trunk@104177 18797224-902f-48f8-a5cc-f745e15eee43 --- .../extensions/inspector/base/src/inLayoutUtils.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/mozilla/extensions/inspector/base/src/inLayoutUtils.cpp b/mozilla/extensions/inspector/base/src/inLayoutUtils.cpp index c34d75b37cb..97287a89bd0 100644 --- a/mozilla/extensions/inspector/base/src/inLayoutUtils.cpp +++ b/mozilla/extensions/inspector/base/src/inLayoutUtils.cpp @@ -342,13 +342,17 @@ inLayoutUtils::GetSubDocumentFor(nsIDOMNode* aNode) nsCOMPtr shell; doc->GetShellAt(0, getter_AddRefs(shell)); if (shell) { - nsCOMPtr subShell; - shell->GetSubShellFor(content, getter_AddRefs(subShell)); - if (!subShell) return nsnull; + nsCOMPtr supports; + shell->GetSubShellFor(content, getter_AddRefs(supports)); + nsCOMPtr docShell = do_QueryInterface(supports); + if (!docShell) + return nsnull; - nsCOMPtr docShell = do_QueryInterface(subShell); nsCOMPtr contentViewer; docShell->GetContentViewer(getter_AddRefs(contentViewer)); + if (!contentViewer) + return nsnull; + nsCOMPtr domdoc; contentViewer->GetDOMDocument(getter_AddRefs(domdoc)); return domdoc;