Check for nil paths on MIME check
This commit is contained in:
parent
406c2e6a01
commit
b5d03d0be7
|
@ -54,6 +54,7 @@ module CouchRest
|
||||||
private
|
private
|
||||||
|
|
||||||
def get_mime_type(path)
|
def get_mime_type(path)
|
||||||
|
return nil if path.nil?
|
||||||
type = ::MIME::Types.type_for(path)
|
type = ::MIME::Types.type_for(path)
|
||||||
type.empty? ? nil : type.first.content_type
|
type.empty? ? nil : type.first.content_type
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue