diff --git a/lib/fog/aws/models/storage/file.rb b/lib/fog/aws/models/storage/file.rb index 2a1ff5a44..e1723c6fd 100644 --- a/lib/fog/aws/models/storage/file.rb +++ b/lib/fog/aws/models/storage/file.rb @@ -50,15 +50,19 @@ module Fog @acl = new_acl end - # Get file's body if exists, else ' '. + # Get file's body if exists, else ''. # # @return [File] # def body - attributes[:body] ||= if last_modified && (file = collection.get(identity)) - file.body + return attributes[:body] if attributes[:body] + return '' unless last_modified + + file = collection.get(identity) + if file + attributes[:body] = file.body else - '' + attributes[:body] = '' end end