]> source.dussan.org Git - redmine.git/commitdiff
Fixed: TypeError in WikiController#destroy_attachment (#1281).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 22 May 2008 18:26:43 +0000 (18:26 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 22 May 2008 18:26:43 +0000 (18:26 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1444 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/attachment.rb

index f44fe8b4d35ae6cdff34760c66d28dcb8fb53de8..45bbd5428b996749499d73be940480e2f9f970b6 100644 (file)
@@ -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