From ab23ab2c9b659eca77c94a5eb96a6f117de8dfd3 Mon Sep 17 00:00:00 2001 From: Riccardo Graziosi <31478034+riggraz@users.noreply.github.com> Date: Thu, 25 Jul 2024 17:54:07 +0200 Subject: [PATCH] Fix email notification when commenting anonymous post (#388) --- app/workflows/send_notification_for_comment_workflow.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/workflows/send_notification_for_comment_workflow.rb b/app/workflows/send_notification_for_comment_workflow.rb index c81a0b59..045cdd9a 100644 --- a/app/workflows/send_notification_for_comment_workflow.rb +++ b/app/workflows/send_notification_for_comment_workflow.rb @@ -15,6 +15,8 @@ class SendNotificationForCommentWorkflow if comment.parent_id == nil # Reply to a post user = comment.post.user + + return if user.nil? # anonymous posts don't have a user if comment.user.id != user.id and user.notifications_enabled? and