mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
FIX: Handle a deleted topic in thumbnail generation
Follow up to 03818e642a1ae871bffdc0c39c10f05f0b8b0398 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…
x
Reference in New Issue
Block a user