Skip to content

Commit

Permalink
Fix 500
Browse files Browse the repository at this point in the history
  • Loading branch information
parterburn committed Jan 9, 2024
1 parent 6e95658 commit b1aab69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/lib/email_processor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,9 @@ def collage_from_mailgun_attachments
break if message.present?
sleep 10
end
return unless message.body["recipients"].to_s.include?(@user.user_key) || message.body["from"].to_s.include?(@user.email)
return unless message.present? && message["recipients"].to_s.include?(@user.user_key) || message["from"].to_s.include?(@user.email)

attachment_urls = message.body["attachments"].map do |att|
attachment_urls = message["attachments"].map do |att|
next unless att["content-type"]&.downcase.in?(['image/gif', 'image/jpeg', 'image/jpg', 'application/octet-stream', 'image/webp', 'image/png', 'image/heic', 'image/heif'])
next unless att["size"].to_i > 20_000

Expand Down

0 comments on commit b1aab69

Please sign in to comment.