mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-31 01:51:24 +01:00
Prevent crash
This commit is contained in:
@@ -236,11 +236,23 @@ public class EntityRule {
|
||||
|
||||
private void onActionMove(Context context, EntityMessage message, JSONObject jargs) throws JSONException {
|
||||
long target = jargs.getLong("target");
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
EntityFolder folder = db.folder().getFolder(target);
|
||||
if (folder == null)
|
||||
throw new IllegalArgumentException("Rule move to folder not found");
|
||||
|
||||
EntityOperation.queue(context, message, EntityOperation.MOVE, target, false);
|
||||
}
|
||||
|
||||
private void onActionCopy(Context context, EntityMessage message, JSONObject jargs) throws JSONException {
|
||||
long target = jargs.getLong("target");
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
EntityFolder folder = db.folder().getFolder(target);
|
||||
if (folder == null)
|
||||
throw new IllegalArgumentException("Rule copy to folder not found");
|
||||
|
||||
EntityOperation.queue(context, message, EntityOperation.COPY, target, false);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user