FIX: Allow for nil upload record when migrating to S3

FIX: Allow for nil upload record when migrating to S3

diff --git a/lib/tasks/uploads.rake b/lib/tasks/uploads.rake
index 0761c4712a..5cfb1b8785 100644
--- a/lib/tasks/uploads.rake
+++ b/lib/tasks/uploads.rake
@@ -428,7 +428,7 @@ def migrate_to_s3
           %Q{attachment; filename="#{upload.original_filename}"}
       end
 
-      if upload.secure
+      if upload&.secure
         options[:acl] = "private"
       end
     end

GitHub sha: 46d8fd38