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

Fixed error handling code when trying to view a message that does not exists

This code was lost during the merge of issue4-1.x branch
This commit is contained in:
Bao-Long Nguyen-Trong 2009-11-21 00:11:57 +00:00
parent 115c4cb6ef
commit 04717b817a

View File

@ -2168,7 +2168,11 @@ public class MessagingController implements Runnable {
LocalFolder localFolder = (LocalFolder) localStore.getFolder(folder);
localFolder.open(OpenMode.READ_WRITE);
Message message = localFolder.getMessage(uid);
LocalMessage message = (LocalMessage)localFolder.getMessage(uid);
if (message==null
|| message.getId()==0) {
throw new IllegalArgumentException("Message not found: folder=" + folder + ", uid=" + uid);
}
for (MessagingListener l : getListeners()) {
l.loadMessageForViewHeadersAvailable(account, folder, uid, message);