1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-28 18:59:01 +00:00

Prevent crash

This commit is contained in:
M66B 2018-12-05 13:59:35 +01:00
parent fd79a9a8ad
commit d813e8129b
2 changed files with 5 additions and 5 deletions

View file

@ -560,9 +560,9 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
draft.getAvatar(context); draft.getAvatar(context);
draft.id = db.message().insertMessage(draft); draft.id = db.message().insertMessage(draft);
draft.write(context, body); draft.write(context, body);
}
EntityOperation.queue(db, draft, EntityOperation.ADD); EntityOperation.queue(db, draft, EntityOperation.ADD);
}
db.setTransactionSuccessful(); db.setTransactionSuccessful();
} finally { } finally {

View file

@ -215,16 +215,16 @@ public class Helper {
draft.getAvatar(context); draft.getAvatar(context);
draft.id = db.message().insertMessage(draft); draft.id = db.message().insertMessage(draft);
draft.write(context, body); draft.write(context, body);
}
EntityOperation.queue(db, draft, EntityOperation.ADD); EntityOperation.queue(db, draft, EntityOperation.ADD);
}
db.setTransactionSuccessful(); db.setTransactionSuccessful();
} finally { } finally {
db.endTransaction(); db.endTransaction();
} }
return draft.id; return (draft == null ? null : draft.id);
} }
@Override @Override