From 101485a41fb2ea326496142d9ccb368522cbe0f0 Mon Sep 17 00:00:00 2001 From: Takeshi Umeda Date: Sun, 19 Jul 2020 20:09:47 +0900 Subject: [PATCH] Fix mimetype returning nil (#14356) --- lib/paperclip/media_type_spoof_detector_extensions.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ''