diff --git a/app/models/optimized_image.rb b/app/models/optimized_image.rb index e77c7d137..c921d462b 100644 --- a/app/models/optimized_image.rb +++ b/app/models/optimized_image.rb @@ -67,7 +67,9 @@ class OptimizedImage < ActiveRecord::Base end # make sure we remove the cached copy from external stores - external_copy.close! if Discourse.store.external? + if Discourse.store.external? + external_copy.try(:close!) rescue nil + end thumbnail end