diff --git a/mailnews/base/util/nsMsgFolder.cpp b/mailnews/base/util/nsMsgFolder.cpp index 7fb3525c36b..5b57f02791b 100644 --- a/mailnews/base/util/nsMsgFolder.cpp +++ b/mailnews/base/util/nsMsgFolder.cpp @@ -2560,14 +2560,16 @@ NS_IMETHODIMP nsMsgFolder::EnableNotifications(PRInt32 notificationType, PRBool // we're probably doing something that should be batched. nsCOMPtr database; - GetMsgDatabase(nsnull, getter_AddRefs(database)); + if (dbBatching) //only if we do dbBatching we need to get db + GetMsgDatabase(nsnull, getter_AddRefs(database)); + if (enable) { - if (database && dbBatching) + if (database) database->EndBatch(); UpdateSummaryTotals(PR_TRUE); } - else if (database && dbBatching) + else if (database) database->StartBatch(); return NS_OK;