Ensure outbox

This commit is contained in:
M66B
2020-03-25 08:47:25 +01:00
parent 83820ef382
commit 1d8d7e9c1c
3 changed files with 16 additions and 8 deletions

View File

@@ -3905,8 +3905,11 @@ public class FragmentCompose extends FragmentBase {
EntityOperation.queue(context, draft, EntityOperation.DELETE);
EntityFolder outbox = db.folder().getOutbox();
if (outbox == null)
throw new IllegalArgumentException("Outbox missing");
if (outbox == null) {
Log.e("Outbox missing");
outbox = EntityFolder.getOutbox();
outbox.id = db.folder().insertFolder(outbox);
}
// Copy message to outbox
draft.id = null;