1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 19:52:17 -05:00

Fixes issue 1171.

This commit is contained in:
cketti 2010-02-03 23:27:33 +00:00
parent c6d29cb10e
commit 88854f4123

View File

@ -2596,7 +2596,7 @@ public class MessagingController implements Runnable
Store localStore = Store.getInstance(account.getLocalStoreUri(), mApplication); Store localStore = Store.getInstance(account.getLocalStoreUri(), mApplication);
localFolder = localStore.getFolder(folderName); localFolder = localStore.getFolder(folderName);
localFolder.open(OpenMode.READ_WRITE); localFolder.open(OpenMode.READ_WRITE);
Message[] messages = new Message[uids.length]; ArrayList<Message> messages = new ArrayList<Message>();
for (int i = 0; i < uids.length; i++) for (int i = 0; i < uids.length; i++)
{ {
String uid = uids[i]; String uid = uids[i];
@ -2607,10 +2607,14 @@ public class MessagingController implements Runnable
{ {
sendCount.remove(uid); sendCount.remove(uid);
} }
messages[i] = localFolder.getMessage(uid); Message msg = localFolder.getMessage(uid);
if (msg != null)
{
messages.add(msg);
}
} }
localFolder.setFlags(messages, new Flag[] {flag}, newState); localFolder.setFlags(messages.toArray(new Message[0]), new Flag[] {flag}, newState);
for (MessagingListener l : getListeners()) for (MessagingListener l : getListeners())