Prevent NPE

pull/215/head
M66B 3 months ago
parent 9ea5094ff8
commit f3cba25195

@ -3640,18 +3640,20 @@ public class IMAPFolder extends Folder implements UIDFolder, ResponseHandler {
String uids = ir.readAtom(); String uids = ir.readAtom();
eu.faircode.email.Log.w("VANISHED earlier=" + (earlier != null) + " uids=" + uids); eu.faircode.email.Log.w("VANISHED earlier=" + (earlier != null) + " uids=" + uids);
UIDSet[] uidset = UIDSet.parseUIDSets(uids); UIDSet[] uidset = UIDSet.parseUIDSets(uids);
List<Message> msgs = new ArrayList<>(); if (uidset != null) {
for (long uid : UIDSet.toArray(uidset)) { List<Message> msgs = new ArrayList<>();
Message m = uidTable.get(uid); for (long uid : UIDSet.toArray(uidset)) {
if (m != null && m.getMessageNumber() > 0) { Message m = uidTable.get(uid);
realTotal--; if (m != null && m.getMessageNumber() > 0) {
messageCache.expungeMessage(m.getMessageNumber()); realTotal--;
msgs.add(m); messageCache.expungeMessage(m.getMessageNumber());
msgs.add(m);
}
} }
if (!msgs.isEmpty() &&
doExpungeNotification && hasMessageCountListener)
notifyMessageRemovedListeners(true, msgs.toArray(new Message[0]));
} }
if (!msgs.isEmpty() &&
doExpungeNotification && hasMessageCountListener)
notifyMessageRemovedListeners(true, msgs.toArray(new Message[0]));
/* /*
String[] s = ir.readAtomStringList(); String[] s = ir.readAtomStringList();
if (s == null) { // no (EARLIER) if (s == null) { // no (EARLIER)

Loading…
Cancel
Save