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;