Salvage draft in case of errors

This is know to happen due to "Exception while computing database live data"
This commit is contained in:
M66B 2019-07-28 14:02:01 +02:00
parent 7b3d0a106b
commit 45379870b1
1 changed files with 4 additions and 1 deletions

View File

@ -2614,7 +2614,10 @@ public class FragmentCompose extends FragmentBase {
null);
}
} else {
String previous = Helper.readText(draft.getFile(context));
File file = draft.getFile(context);
if (!file.exists())
Helper.writeText(file, body);
String previous = Helper.readText(file);
if (!body.equals(previous) ||
plain_only != (draft.plain_only != null && draft.plain_only)) {
dirty = true;