mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Checking path for nil
This commit is contained in:
parent
c8244b4930
commit
99a932ef6d
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue