From 1f92298ca3f8230787fc351ad58ab8da8ead911d Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Wed, 22 Jan 2003 08:29:03 +0000 Subject: [PATCH] fix for bug #189933 bulletproofing for news crasher when downloading list of newsgroups until I can reproduce it. r/sr=bienvenu git-svn-id: svn://10.0.0.236/trunk@136836 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/news/src/nsNNTPProtocol.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mozilla/mailnews/news/src/nsNNTPProtocol.cpp b/mozilla/mailnews/news/src/nsNNTPProtocol.cpp index af9a774ad0a..c393c71d6fd 100644 --- a/mozilla/mailnews/news/src/nsNNTPProtocol.cpp +++ b/mozilla/mailnews/news/src/nsNNTPProtocol.cpp @@ -3166,7 +3166,7 @@ static void ComputeRate(PRInt32 bytes, PRTime startTime, float *rate) */ PRInt32 nsNNTPProtocol::ReadNewsList(nsIInputStream * inputStream, PRUint32 length) { - nsresult rv; + nsresult rv = NS_OK; PRInt32 i=0; PRUint32 status = 1; @@ -3188,7 +3188,10 @@ PRInt32 nsNNTPProtocol::ReadNewsList(nsIInputStream * inputStream, PRUint32 leng if (line[0]=='.' && line[1]=='\0') { PRBool listpnames=PR_FALSE; - rv = m_nntpServer->QueryExtension("LISTPNAMES",&listpnames); + NS_ASSERTION(m_nntpServer, "no nntp incoming server"); + if (m_nntpServer) { + rv = m_nntpServer->QueryExtension("LISTPNAMES",&listpnames); + } if (NS_SUCCEEDED(rv) && listpnames) m_nextState = NNTP_LIST_PRETTY_NAMES; else @@ -3265,7 +3268,7 @@ PRInt32 nsNNTPProtocol::ReadNewsList(nsIInputStream * inputStream, PRUint32 leng } } - /* find whitespace separator if it exits */ + /* find whitespace separator if it exits */ for(i=0; line[i] != '\0' && !NET_IS_SPACE(line[i]); i++) ; /* null body */