From 94c89be713384fbb883b1744e6a9c792c86fef4f Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Thu, 30 Nov 2000 21:59:01 +0000 Subject: [PATCH] fix for #59421. sr=bienvenu. prevent the crash when saving a news message with a unicode file name. the save still fails, but at least you don't crash. --- mailnews/news/src/nsNNTPProtocol.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mailnews/news/src/nsNNTPProtocol.cpp b/mailnews/news/src/nsNNTPProtocol.cpp index 50217a94c1fd..d5d28945e295 100644 --- a/mailnews/news/src/nsNNTPProtocol.cpp +++ b/mailnews/news/src/nsNNTPProtocol.cpp @@ -2162,7 +2162,11 @@ PRInt32 nsNNTPProtocol::BeginArticle() nsCOMPtr supports; NS_NewIOFileStream(getter_AddRefs(supports), fileSpec, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE, 00700); - m_tempArticleStream = do_QueryInterface(supports); + nsresult rv; + m_tempArticleStream = do_QueryInterface(supports, &rv); + NS_ASSERTION(NS_SUCCEEDED(rv) && m_tempArticleStream,"failed to get article stream"); + if (NS_FAILED(rv) || !m_tempArticleStream) return -1; + PRBool needDummyHeaders = PR_FALSE; msgurl->GetAddDummyEnvelope(&needDummyHeaders); if (needDummyHeaders)