Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
Ensure filename is not nil before cheking file existance
Browse files Browse the repository at this point in the history
  • Loading branch information
danielevans committed Aug 26, 2011
1 parent 7696b88 commit 89ecde4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/paperclip/attachment.rb
Expand Up @@ -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

Expand Down

0 comments on commit 89ecde4

Please sign in to comment.