]> source.dussan.org Git - redmine.git/commitdiff
NoMethodError when uploading a file without logger (#14977).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 5 Oct 2013 11:37:57 +0000 (11:37 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 5 Oct 2013 11:37:57 +0000 (11:37 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12202 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/attachment.rb

index dd1aa3a7c9b959a913b3f452c276b8721f99723c..b289b0f479ce0dc416d7a6b05f3d3daa1fd032ea 100644 (file)
@@ -102,7 +102,7 @@ class Attachment < ActiveRecord::Base
     if @temp_file && (@temp_file.size > 0)
       self.disk_directory = target_directory
       self.disk_filename = Attachment.disk_filename(filename, disk_directory)
-      logger.info("Saving attachment '#{self.diskfile}' (#{@temp_file.size} bytes)")
+      logger.info("Saving attachment '#{self.diskfile}' (#{@temp_file.size} bytes)") if logger
       path = File.dirname(diskfile)
       unless File.directory?(path)
         FileUtils.mkdir_p(path)