mirror of
https://github.com/discourse/discourse.git
synced 2025-03-25 17:57:23 +08:00
FIX: check for existence of topic before looking for category
This commit is contained in:
parent
aee4045dd0
commit
392f184b24
@ -421,7 +421,7 @@ class UserNotifications < ActionMailer::Base
|
||||
end
|
||||
|
||||
# category name
|
||||
category = Topic.find_by(id: post.topic_id).category
|
||||
category = Topic.find_by(id: post.topic_id)&.category
|
||||
if opts[:show_category_in_subject] && post.topic_id && category && !category.uncategorized?
|
||||
show_category_in_subject = category.name
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user