FIX: check for existence of post before creating notification

This commit is contained in:
Arpit Jalan 2020-03-16 14:11:11 +05:30
parent 4cce564b35
commit f861345888
1 changed files with 1 additions and 1 deletions

View File

@ -280,7 +280,7 @@ class PostAlerter
DiscourseEvent.trigger(:before_create_notification, user, type, post, opts) DiscourseEvent.trigger(:before_create_notification, user, type, post, opts)
return if user.blank? || user.bot? return if user.blank? || user.bot? || post.blank?
return if (topic = post.topic).blank? return if (topic = post.topic).blank?
is_liked = type == Notification.types[:liked] is_liked = type == Notification.types[:liked]