diff --git a/dom/src/base/nsGlobalWindow.cpp b/dom/src/base/nsGlobalWindow.cpp index d6957e79882..86588b54a47 100644 --- a/dom/src/base/nsGlobalWindow.cpp +++ b/dom/src/base/nsGlobalWindow.cpp @@ -3247,6 +3247,11 @@ NS_IMETHODIMP GlobalWindowImpl::GetTreeOwner(nsIBaseWindow** aTreeOwner) nsCOMPtr treeOwner; docShellAsItem->GetTreeOwner(getter_AddRefs(treeOwner)); + if(!treeOwner) + { + *aTreeOwner = nsnull; + return NS_OK; + } return CallQueryInterface(treeOwner, aTreeOwner); }