mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -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
|
# just ditch the optimized image if there was any errors
|
||||||
optimized_image.destroy
|
optimized_image.destroy
|
||||||
ensure
|
ensure
|
||||||
file&.unlink
|
|
||||||
file&.close
|
file&.close
|
||||||
|
file&.unlink if file&.respond_to?(:unlink)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user