]> cat aescling's git repositories - mastodon.git/commitdiff
Fix backups failing when files are missing from media attachments (#13146)
authorThibG <thib@sitedethib.com>
Mon, 24 Feb 2020 20:18:26 +0000 (21:18 +0100)
committerGitHub <noreply@github.com>
Mon, 24 Feb 2020 20:18:26 +0000 (21:18 +0100)
Fixes #13123

app/services/backup_service.rb

index d1090dff1b8577154fc9cc2371b5c657ca151a3f..89669932450bb1f19841fb0566d192fc23c46206 100644 (file)
@@ -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