Prevent NPE

pull/215/head
M66B 5 months ago
parent 2aaa3e96d4
commit 458997e4fa

@ -1815,9 +1815,12 @@ class Core {
IMAPFolder itrash = (IMAPFolder) istore.getFolder(trash.name);
Message[] imessages = ifolder.getMessagesByUID(Helper.toLongArray(uids));
List<Message> imove = new ArrayList<>();
if (imessages != null)
for (Message imessage : imessages)
if (imessage instanceof GmailMessage)
try {
imove.add(imessage);
String[] labels = ((GmailMessage) imessage).getLabels();
for (String label : labels)
if (!folders.containsKey(label)) {
@ -1829,7 +1832,7 @@ class Core {
Log.e(ex);
}
ifolder.moveMessages(imessages, itrash);
ifolder.moveMessages(imove.toArray(new Message[0]), itrash);
itrash.open(READ_WRITE);
try {

Loading…
Cancel
Save