mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 23:07:28 +08:00
FIX: only call 'unlink' for tempfiles
This commit is contained in:
@ -407,8 +407,8 @@ class OptimizedImage < ActiveRecord::Base
|
||||
# just ditch the optimized image if there was any errors
|
||||
optimized_image.destroy
|
||||
ensure
|
||||
file&.unlink
|
||||
file&.close
|
||||
file&.unlink if file&.respond_to?(:unlink)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user