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:
parent
7c2fb4c6c0
commit
f714d16e50
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue