Skip to content

A platform for community discussion. Free, open, simple.

FIX: check for existence of post before creating notification

Arpit Jalanf861345888ba
diff --git a/app/services/post_alerter.rb b/app/services/post_alerter.rb
index ea1b8105903..ae560ec2fd9 100644
--- a/app/services/post_alerter.rb
+++ b/app/services/post_alerter.rb
@@ -280,7 +280,7 @@ class PostAlerter
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?
is_liked = type == Notification.types[:liked]