FIX: properly handle external image download errors

This commit is contained in:
Régis Hanol 2015-06-10 18:18:20 +02:00
parent bdfdbcd217
commit a52d31e25e
1 changed files with 1 additions and 1 deletions

View File

@ -26,7 +26,7 @@ class OptimizedImage < ActiveRecord::Base
# create the thumbnail otherwise # create the thumbnail otherwise
original_path = Discourse.store.path_for(upload) original_path = Discourse.store.path_for(upload)
if original_path.blank? if original_path.blank?
external_copy = Discourse.store.download(upload) external_copy = Discourse.store.download(upload) rescue nil
original_path = external_copy.try(:path) original_path = external_copy.try(:path)
end end