Added extra check

pull/198/head
M66B 4 years ago
parent 3bff0b11a8
commit 80f333d969

@ -648,9 +648,17 @@ class Core {
Long uid = findUid(context, ifolder, message.msgid, false); Long uid = findUid(context, ifolder, message.msgid, false);
if (uid == null) { if (uid == null) {
if (EntityFolder.DRAFTS.equals(folder.type) && if (EntityOperation.MOVE.equals(op.name) &&
EntityOperation.MOVE.equals(op.name)) EntityFolder.DRAFTS.equals(folder.type))
db.message().deleteMessage(message.id); try {
long fid = new JSONArray(op.args).optLong(0, -1L);
EntityFolder target = db.folder().getFolder(fid);
if (target != null && EntityFolder.TRASH.equals(folder.type))
db.message().deleteMessage(message.id);
} catch (JSONException ex) {
Log.e(ex);
}
throw new IllegalArgumentException("Message not found for " + op.name + " folder=" + folder.name); throw new IllegalArgumentException("Message not found for " + op.name + " folder=" + folder.name);
} }

Loading…
Cancel
Save