Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ensure filename is not nil before cheking file existance

  • Loading branch information...
commit 89ecde4825da0f422c9d590f1b9117f7ed0fd663 1 parent 7696b88
@danielevans danielevans authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/paperclip/attachment.rb
View
2  lib/paperclip/attachment.rb
@@ -424,7 +424,7 @@ def flush_errors #:nodoc:
def after_flush_writes
@queued_for_write.each do |style, file|
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
Please sign in to comment.
Something went wrong with that request. Please try again.