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

Added file existence check before file deletion attempt

This commit is contained in:
Michael Harrison 2012-10-17 14:53:53 +10:00
parent 7c2fb4c6c0
commit f714d16e50

View file

@ -38,7 +38,8 @@ module Fog
def destroy
requires :directory, :key
connection.delete_namespace([directory.key, key].join('/'))
file = directory.files.head(key)
connection.delete_namespace([directory.key, key].join('/')) if file.present?
true
end