From: ThibG Date: Mon, 24 Feb 2020 20:18:26 +0000 (+0100) Subject: Fix backups failing when files are missing from media attachments (#13146) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=d91946ae134f84889f26a08987cb75abeab62742;p=mastodon.git Fix backups failing when files are missing from media attachments (#13146) Fixes #13123 --- diff --git a/app/services/backup_service.rb b/app/services/backup_service.rb index d1090dff1..896699324 100644 --- a/app/services/backup_service.rb +++ b/app/services/backup_service.rb @@ -66,6 +66,8 @@ class BackupService < BaseService def dump_media_attachments!(tar) MediaAttachment.attached.where(account: account).reorder(nil).find_in_batches do |media_attachments| media_attachments.each do |m| + next unless m.file&.path + download_to_tar(tar, m.file, m.file.path) end