mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 18:24:52 -06:00
FIX: only call 'unlink' for tempfiles
This commit is contained in:
parent
7ff994b6ea
commit
ad12b2a23d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user