Skip to content

A platform for community discussion. Free, open, simple.

Work around deleted upload.access_control_post scoping issue

Martin Brennan5dc6100acca6
diff --git a/lib/upload_security.rb b/lib/upload_security.rb
index 039b03d158b..86647892372 100644
--- a/lib/upload_security.rb
+++ b/lib/upload_security.rb
@@ -60,6 +60,9 @@ class UploadSecurity
# if there is no access control post id and the upload is currently secure, we
# do not want to make it un-secure to avoid unintentionally exposing it
def access_control_post_has_secure_media?
+ # if the post is deleted the access_control_post will be blank...
+ # TODO: deal with this in a better way
+ return false if @upload.access_control_post.blank?
@upload.access_control_post.with_secure_media?
end