Skip to content
Browse files

Ensure filename is not nil before cheking file existance

  • Loading branch information...
1 parent 7696b88 commit 89ecde4825da0f422c9d590f1b9117f7ed0fd663 @danielevans danielevans committed Aug 26, 2011
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

0 comments on commit 89ecde4

Please sign in to comment.
Something went wrong with that request. Please try again.