diff --git a/mailnews/compose/src/nsMsgComposeService.cpp b/mailnews/compose/src/nsMsgComposeService.cpp index 9be01e8636..a7f33076b9 100644 --- a/mailnews/compose/src/nsMsgComposeService.cpp +++ b/mailnews/compose/src/nsMsgComposeService.cpp @@ -827,7 +827,11 @@ nsMsgComposeService::CacheWindow(nsIDOMWindow *aWindow, bool aComposeHTML, nsIMs nsCOMPtr treeItem(do_QueryInterface(window->GetDocShell(), &rv)); NS_ENSURE_SUCCESS(rv, rv); - nsCOMPtr xulWindow(do_GetInterface(treeItem, &rv)); + nsCOMPtr treeOwner; + rv = treeItem->GetTreeOwner(getter_AddRefs(treeOwner)); + NS_ENSURE_SUCCESS(rv,rv); + + nsCOMPtr xulWindow(do_GetInterface(treeOwner, &rv)); NS_ENSURE_SUCCESS(rv, rv); int32_t i;