diff --git a/app/src/main/java/org/thoughtcrime/securesms/backup/BackupFileIOError.java b/app/src/main/java/org/thoughtcrime/securesms/backup/BackupFileIOError.java index 49d669900..76b28646f 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/backup/BackupFileIOError.java +++ b/app/src/main/java/org/thoughtcrime/securesms/backup/BackupFileIOError.java @@ -58,9 +58,7 @@ public enum BackupFileIOError { if (error != null) { error.postNotification(context); - } - - if (error == null) { + } else { UNKNOWN.postNotification(context); } } diff --git a/app/src/main/java/org/thoughtcrime/securesms/backup/FullBackupExporter.java b/app/src/main/java/org/thoughtcrime/securesms/backup/FullBackupExporter.java index de1e524d2..1497ed833 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/backup/FullBackupExporter.java +++ b/app/src/main/java/org/thoughtcrime/securesms/backup/FullBackupExporter.java @@ -54,6 +54,7 @@ import org.thoughtcrime.securesms.util.TextSecurePreferences; import org.thoughtcrime.securesms.util.Util; import java.io.File; +import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; @@ -376,9 +377,11 @@ public class FullBackupExporter extends FullBackupBase { } if (!TextUtils.isEmpty(data) && size > 0) { + EventBus.getDefault().post(new BackupEvent(BackupEvent.Type.PROGRESS, ++count, estimatedCount)); try (InputStream inputStream = openAttachmentStream(attachmentSecret, random, data)) { - EventBus.getDefault().post(new BackupEvent(BackupEvent.Type.PROGRESS, ++count, estimatedCount)); outputStream.write(new AttachmentId(rowId, uniqueId), inputStream, size); + } catch (FileNotFoundException e) { + Log.w(TAG, "Missing attachment: " + e.getMessage()); } } @@ -402,6 +405,8 @@ public class FullBackupExporter extends FullBackupBase { EventBus.getDefault().post(new BackupEvent(BackupEvent.Type.PROGRESS, ++count, estimatedCount)); try (InputStream inputStream = ModernDecryptingPartInputStream.createFor(attachmentSecret, random, new File(data), 0)) { outputStream.writeSticker(rowId, inputStream, size); + } catch (FileNotFoundException e) { + Log.w(TAG, "Missing sticker: " + e.getMessage()); } }