Delete attachments with mismatched size during backup export

Fixes #139
This commit is contained in:
Oscar Mira 2023-03-20 18:17:29 +01:00
parent b363ae5d2f
commit 62080cfe92

View file

@ -669,10 +669,8 @@ public class FullBackupExporter extends FullBackupBase {
long totalWritten = writeStream(in);
if (totalWritten != size) {
if (totalWritten == 0) {
// MOLLY: Quick workaround for zero-sized broken attachments
SignalDatabase.attachments().deleteAttachment(attachmentId);
}
// MOLLY: Quick workaround for broken attachments
SignalDatabase.attachments().deleteAttachment(attachmentId);
throw new IOException("Size mismatch!");
}
}