mirror of https://github.com/M66B/FairEmail.git
Quick fix for remote deleted message being composed
This will be a rare case
This commit is contained in:
parent
f85ef0579b
commit
ec83d142f4
|
@ -60,6 +60,7 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.mail.Address;
|
import javax.mail.Address;
|
||||||
|
import javax.mail.MessageRemovedException;
|
||||||
import javax.mail.internet.InternetAddress;
|
import javax.mail.internet.InternetAddress;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
@ -688,6 +689,11 @@ public class FragmentCompose extends FragmentEx {
|
||||||
EntityMessage draft = db.message().getMessage(id);
|
EntityMessage draft = db.message().getMessage(id);
|
||||||
EntityIdentity identity = db.identity().getIdentity(iid);
|
EntityIdentity identity = db.identity().getIdentity(iid);
|
||||||
|
|
||||||
|
// Draft deleted by server
|
||||||
|
// TODO: better handling of remote deleted message
|
||||||
|
if (draft == null)
|
||||||
|
throw new MessageRemovedException();
|
||||||
|
|
||||||
// Convert data
|
// Convert data
|
||||||
Address afrom[] = (identity == null ? null : new Address[]{new InternetAddress(identity.email, identity.name)});
|
Address afrom[] = (identity == null ? null : new Address[]{new InternetAddress(identity.email, identity.name)});
|
||||||
Address ato[] = (TextUtils.isEmpty(to) ? null : InternetAddress.parse(to));
|
Address ato[] = (TextUtils.isEmpty(to) ? null : InternetAddress.parse(to));
|
||||||
|
|
Loading…
Reference in New Issue