about summary refs log tree commit diff
path: root/lib/paperclip
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2020-07-19 20:09:47 +0900
committerGitHub <noreply@github.com>2020-07-19 13:09:47 +0200
commit101485a41fb2ea326496142d9ccb368522cbe0f0 (patch)
tree628a90da9eb85d6d085cd7c71973c3acbc4767a7 /lib/paperclip
parenta29080256ecb39c7c719a7717fa15d3bc6d9776b (diff)
Fix mimetype returning nil (#14356)
Diffstat (limited to 'lib/paperclip')
-rw-r--r--lib/paperclip/media_type_spoof_detector_extensions.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/paperclip/media_type_spoof_detector_extensions.rb b/lib/paperclip/media_type_spoof_detector_extensions.rb
index 363934d8d..43337cc68 100644
--- a/lib/paperclip/media_type_spoof_detector_extensions.rb
+++ b/lib/paperclip/media_type_spoof_detector_extensions.rb
@@ -18,7 +18,7 @@ module Paperclip
       @type_from_mime_magic ||= begin
         begin
           File.open(@file.path) do |file|
-            MimeMagic.by_magic(file)&.type
+            MimeMagic.by_magic(file)&.type || ''
           end
         rescue Errno::ENOENT
           ''