mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-02-17 04:01:29 -05:00
migrate_to_s3: check for missing local files
If an image is already on S3, but not available locally (eg. if they're already migrated), `path` is nil. This crashes the task, because File.exists?(nil) is not valid.
This commit is contained in:
parent
a0834d17b2
commit
ca8c5f7382
1 changed files with 1 additions and 1 deletions
|
@ -134,7 +134,7 @@ def migrate_to_s3
|
|||
# retrieve the path to the local file
|
||||
path = local.path_for(upload)
|
||||
# make sure the file exists locally
|
||||
if !File.exists?(path)
|
||||
if !path or !File.exists?(path)
|
||||
putc "X"
|
||||
next
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue