Changed GetTopmostMsgWindow, added pointer checks after the dom function calls,

bug 144735, r=ducarroz, sr=bienvenu.
This commit is contained in:
nhotta%netscape.com 2002-05-16 00:31:56 +00:00
Родитель 338f2f561a
Коммит bcc7e5464d
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -393,15 +393,19 @@ nsresult nsMsgMailSession::GetTopmostMsgWindow(nsIMsgWindow* *aMsgWindow)
{
rv = windowEnum->GetNext(getter_AddRefs(windowSupports));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_TRUE(windowSupports, NS_ERROR_FAILURE);
topMostWindow = do_QueryInterface(windowSupports, &rv);
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_TRUE(topMostWindow, NS_ERROR_FAILURE);
rv = topMostWindow->GetDocument(getter_AddRefs(domDocument));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_TRUE(domDocument, NS_ERROR_FAILURE);
rv = domDocument->GetDocumentElement(getter_AddRefs(domElement));
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_TRUE(domElement, NS_ERROR_FAILURE);
rv = domElement->GetAttribute(NS_LITERAL_STRING("windowtype"), windowType);
NS_ENSURE_SUCCESS(rv, rv);