Check if attachment upload was canceled

This commit is contained in:
M66B 2019-06-05 13:48:40 +02:00
parent 1a08fe8058
commit bb9a634a07
1 changed files with 1 additions and 2 deletions

View File

@ -1845,7 +1845,7 @@ public class FragmentCompose extends FragmentBase {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean autoresize = prefs.getBoolean("autoresize", true);
if (autoresize &&
if (autoresize && file.exists() /* upload cancelled */ &&
("image/jpeg".equals(attachment.type) || "image/png".equals(attachment.type))) {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
@ -1891,7 +1891,6 @@ public class FragmentCompose extends FragmentBase {
db.attachment().setDownloaded(attachment.id, size);
} catch (IOException ex) {
// Reset progress on failure
db.attachment().setProgress(attachment.id, null);