summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-05-22 18:26:43 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-05-22 18:26:43 +0000
commite02e047dd4a8f171225bcc4ca904474d9f89adcc (patch)
treed28c04d4bbf3e3dc635495125ac8beebac5abd2e /app
parent82c12d09e94c502358b38166c5b239eb4ffcfff9 (diff)
downloadredmine-e02e047dd4a8f171225bcc4ca904474d9f89adcc.tar.gz
redmine-e02e047dd4a8f171225bcc4ca904474d9f89adcc.zip
Fixed: TypeError in WikiController#destroy_attachment (#1281).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1444 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/attachment.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/app/models/attachment.rb b/app/models/attachment.rb
index f44fe8b4d..45bbd5428 100644
--- a/app/models/attachment.rb
+++ b/app/models/attachment.rb
@@ -68,9 +68,7 @@ class Attachment < ActiveRecord::Base
# Deletes file on the disk
def after_destroy
- if self.filename?
- File.delete(diskfile) if File.exist?(diskfile)
- end
+ File.delete(diskfile) if !filename.blank? && File.exist?(diskfile)
end
# Returns file's location on disk