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
|
end
|
||||||
|
|
||||||
# category name
|
# 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?
|
if opts[:show_category_in_subject] && post.topic_id && category && !category.uncategorized?
|
||||||
show_category_in_subject = category.name
|
show_category_in_subject = category.name
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue