diff --git a/src/org/thoughtcrime/securesms/backup/FullBackupExporter.java b/src/org/thoughtcrime/securesms/backup/FullBackupExporter.java index 8577b0465f..7366c56619 100644 --- a/src/org/thoughtcrime/securesms/backup/FullBackupExporter.java +++ b/src/org/thoughtcrime/securesms/backup/FullBackupExporter.java @@ -265,8 +265,11 @@ public class FullBackupExporter extends FullBackupBase { while ((read = in.read(buffer)) != -1) { byte[] ciphertext = cipher.update(buffer, 0, read); - outputStream.write(ciphertext); - mac.update(ciphertext); + + if (ciphertext != null) { + outputStream.write(ciphertext); + mac.update(ciphertext); + } } byte[] remainder = cipher.doFinal();