kopia lustrzana https://github.com/ryukoposting/Signal-Android
Do not fail backup when missing attachments.
rodzic
90be2a0e53
commit
41a7560e76
|
@ -376,8 +376,8 @@ public class FullBackupExporter extends FullBackupBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(data) && size > 0) {
|
|
||||||
EventBus.getDefault().post(new BackupEvent(BackupEvent.Type.PROGRESS, ++count, estimatedCount));
|
EventBus.getDefault().post(new BackupEvent(BackupEvent.Type.PROGRESS, ++count, estimatedCount));
|
||||||
|
if (!TextUtils.isEmpty(data) && size > 0) {
|
||||||
try (InputStream inputStream = openAttachmentStream(attachmentSecret, random, data)) {
|
try (InputStream inputStream = openAttachmentStream(attachmentSecret, random, data)) {
|
||||||
outputStream.write(new AttachmentId(rowId, uniqueId), inputStream, size);
|
outputStream.write(new AttachmentId(rowId, uniqueId), inputStream, size);
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
|
@ -423,6 +423,8 @@ public class FullBackupExporter extends FullBackupBase {
|
||||||
while ((read = inputStream.read(buffer, 0, buffer.length)) != -1) {
|
while ((read = inputStream.read(buffer, 0, buffer.length)) != -1) {
|
||||||
result += read;
|
result += read;
|
||||||
}
|
}
|
||||||
|
} catch (FileNotFoundException e) {
|
||||||
|
Log.w(TAG, "Missing attachment: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Ładowanie…
Reference in New Issue