Check for nil paths on MIME check

This commit is contained in:
Sam Lown 2010-06-08 00:17:43 +02:00
parent 406c2e6a01
commit b5d03d0be7

View file

@ -54,6 +54,7 @@ module CouchRest
private
def get_mime_type(path)
return nil if path.nil?
type = ::MIME::Types.type_for(path)
type.empty? ? nil : type.first.content_type
end