don't try to autosync 0 byte messages, 455964, r/sr=dmose
authorDavid Bienvenu <bienvenu@nventure.com>
Tue, 23 Sep 2008 17:16:54 -0700
changeset 416 cf06d06fbff078a944d0bcda2247b0f51be6aca8
parent 415 0873795c1cc4502a4b90b9354c9a9d6e27fb7e63
child 417 37fa1b54be81302ecfc684a41c8465fe4eb39ea6
push idunknown
push userunknown
push dateunknown
bugs455964
don't try to autosync 0 byte messages, 455964, r/sr=dmose
mailnews/imap/src/nsAutoSyncState.cpp
--- a/mailnews/imap/src/nsAutoSyncState.cpp
+++ b/mailnews/imap/src/nsAutoSyncState.cpp
@@ -285,16 +285,20 @@ NS_IMETHODIMP nsAutoSyncState::GetNextGr
         {
           PRBool excluded = PR_FALSE;
           if (NS_SUCCEEDED(msgStrategy->IsExcluded(folder, qhdr, &excluded)) && excluded)
             continue;
         }
 
         PRUint32 msgSize;
         qhdr->GetMessageSize(&msgSize);
+        // ignore 0 byte messages; the imap parser asserts when we try 
+        // to download them, and there's no point anyway.
+        if (!msgSize)
+          continue;
         
         if (totalSize == 0 && msgSize >= groupSize) 
         {
           group->AppendElement(qhdr, PR_FALSE);
           idx++;
           break;
         }
         else if (totalSize + msgSize > groupSize)