Fixed crash

pull/147/head
M66B 6 years ago
parent a03b41506c
commit c58615e15e

@ -2438,12 +2438,15 @@ public class ServiceSynchronize extends LifecycleService {
if (!metered || (attachment.size != null && attachment.size < download)) { if (!metered || (attachment.size != null && attachment.size < download)) {
if (iattachments == null) if (iattachments == null)
iattachments = helper.getAttachments(); iattachments = helper.getAttachments();
// Attachments of drafts might not have been uploaded yet
if (i < iattachments.size()) {
attachment.part = iattachments.get(i).part; attachment.part = iattachments.get(i).part;
attachment.download(context, db); attachment.download(context, db);
Log.i(Helper.TAG, folder.name + " downloaded message id=" + message.id + " attachment=" + attachment.name + " size=" + message.size); Log.i(Helper.TAG, folder.name + " downloaded message id=" + message.id + " attachment=" + attachment.name + " size=" + message.size);
} }
} }
} }
}
private class ServiceManager extends ConnectivityManager.NetworkCallback { private class ServiceManager extends ConnectivityManager.NetworkCallback {
private ServiceState state; private ServiceState state;

Loading…
Cancel
Save