diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 1dacffb6f..fe3c3272a 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -660,8 +660,8 @@ class AttachmentsController < ApplicationController end def has_login - unless @attachment && @attachment.container_type == "Organization" - unless @attachment && @attachment.container_type == "PhoneAppVersion" + unless (@attachment && @attachment.container_type == "Organization").nil? + unless (@attachment && @attachment.container_type == "PhoneAppVersion").nil? render_403 if !User.current.logged? && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download) end end