Commit 89ecde48 by Daniel Evans

Ensure filename is not nil before cheking file existance

parent 7696b88d
...@@ -424,7 +424,7 @@ module Paperclip ...@@ -424,7 +424,7 @@ module Paperclip
def after_flush_writes def after_flush_writes
@queued_for_write.each do |style, file| @queued_for_write.each do |style, file|
file.close unless file.closed? file.close unless file.closed?
file.unlink if file.respond_to?(:unlink) && File.exist?(file.path) file.unlink if file.respond_to?(:unlink) && file.path.present? && File.exist?(file.path)
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment