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);