mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 01:45:07 +08:00
FIX: Email attachments with a size of 0 bytes caused error
This commit is contained in:
@ -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]
|
||||
|
Reference in New Issue
Block a user