FIX: Handle a deleted topic in thumbnail generation
Follow up to 03818e642a
A topic can be deleted between job enqueue and job execution
This commit is contained in:
parent
6e3fe1abba
commit
4d137b4f89
|
@ -10,8 +10,8 @@ module Jobs
|
|||
|
||||
raise Discourse::InvalidParameters.new(:topic_id) if topic_id.blank?
|
||||
|
||||
topic = Topic.find(topic_id)
|
||||
topic.generate_thumbnails!(extra_sizes: extra_sizes)
|
||||
topic = Topic.find_by(id: topic_id)
|
||||
topic&.generate_thumbnails!(extra_sizes: extra_sizes)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue