FIX: Email attachments with a size of 0 bytes caused error

This commit is contained in:
Gerhard Schlager
2020-02-03 18:21:22 +01:00
parent 67d5ce8ed1
commit e84d88ddea
3 changed files with 62 additions and 1 deletions

View File

@ -1044,7 +1044,7 @@ module Email
# create the upload for the user
opts = { for_group_message: options[:is_group_message] }
upload = UploadCreator.new(tmp, attachment.filename, opts).create_for(user.id)
if upload&.valid?
if upload.errors.empty?
# try to inline images
if attachment.content_type&.start_with?("image/")
if raw[attachment.url]