1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request from TimothyKlim/master

Checking path for nil
This commit is contained in:
Wesley Beary 2011-06-27 11:20:12 -07:00
commit 37000e0b9e

View file

@ -60,7 +60,7 @@ module Fog
metadata[:body] = data
metadata[:headers]['Content-Length'] = get_body_size(data)
if data.respond_to?(:path)
if data.respond_to?(:path) and !data.path.nil?
filename = ::File.basename(data.path)
unless (mime_types = MIME::Types.of(filename)).empty?
metadata[:headers]['Content-Type'] = mime_types.first.content_type