mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-27 19:52:17 -05:00
Bulletproofing against running IMAP Copy/Move commands with null messagelists. Fixes Issue 914
This commit is contained in:
parent
87c8599504
commit
dc2f752f11
@ -698,6 +698,10 @@ public class ImapStore extends Store
|
||||
{
|
||||
throw new MessagingException("ImapFolder.copyMessages passed non-ImapFolder");
|
||||
}
|
||||
|
||||
if (messages.length == 0)
|
||||
return;
|
||||
|
||||
ImapFolder iFolder = (ImapFolder)folder;
|
||||
checkOpen();
|
||||
String[] uids = new String[messages.length];
|
||||
@ -720,12 +724,17 @@ public class ImapStore extends Store
|
||||
@Override
|
||||
public void moveMessages(Message[] messages, Folder folder) throws MessagingException
|
||||
{
|
||||
if (messages.length == 0)
|
||||
return;
|
||||
copyMessages(messages, folder);
|
||||
setFlags(messages, new Flag[] { Flag.DELETED }, true);
|
||||
}
|
||||
|
||||
public void delete(Message[] messages, String trashFolderName) throws MessagingException
|
||||
{
|
||||
if (messages.length == 0)
|
||||
return;
|
||||
|
||||
if (getName().equals(trashFolderName))
|
||||
{
|
||||
setFlags(messages, new Flag[] { Flag.DELETED }, true);
|
||||
|
Loading…
Reference in New Issue
Block a user