Fix mimetype returning nil (#14356)

signup-info-prompt
Takeshi Umeda 2020-07-19 20:09:47 +09:00 committed by GitHub
parent a29080256e
commit 101485a41f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -18,7 +18,7 @@ module Paperclip
@type_from_mime_magic ||= begin @type_from_mime_magic ||= begin
begin begin
File.open(@file.path) do |file| File.open(@file.path) do |file|
MimeMagic.by_magic(file)&.type MimeMagic.by_magic(file)&.type || ''
end end
rescue Errno::ENOENT rescue Errno::ENOENT
'' ''