From 1557fa38886439a32368082b980047d59f3d63d8 Mon Sep 17 00:00:00 2001 From: "sspitzer%netscape.com" Date: Tue, 21 Aug 2001 04:17:27 +0000 Subject: [PATCH] fix for #96164. don't make a connection to the news server when updating unread counts if there are no groups. r/sr=bienvenu --- mailnews/news/src/nsNntpIncomingServer.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mailnews/news/src/nsNntpIncomingServer.cpp b/mailnews/news/src/nsNntpIncomingServer.cpp index 8bf5494b20b8..b42bc3eaf358 100644 --- a/mailnews/news/src/nsNntpIncomingServer.cpp +++ b/mailnews/news/src/nsNntpIncomingServer.cpp @@ -577,6 +577,15 @@ nsNntpIncomingServer::PerformExpand(nsIMsgWindow *aMsgWindow) { nsresult rv; + // a user might have a new server without any groups. + // if so, bail out. no need to establish a connection to the server + PRInt32 numGroups = 0; + rv = GetNumGroupsNeedingCounts(&numGroups); + NS_ENSURE_SUCCESS(rv,rv); + + if (!numGroups) + return NS_OK; + nsCOMPtr nntpService = do_GetService(NS_NNTPSERVICE_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv,rv);