瀏覽代碼

Fix backups failing when files are missing from media attachments (#13146)

Fixes #13123
ThibG 4 年之前
父節點
當前提交
d91946ae13
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      app/services/backup_service.rb

+ 2 - 0
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