From fbd92916e553000f847f063f7f64808ef4cbd8ef Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Fri, 21 Dec 2018 15:09:27 +0100 Subject: [PATCH] FIX: Narrative bot should ignore action on deleted post --- plugins/discourse-narrative-bot/plugin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/discourse-narrative-bot/plugin.rb b/plugins/discourse-narrative-bot/plugin.rb index c321a28f2cf..b51e3181473 100644 --- a/plugins/discourse-narrative-bot/plugin.rb +++ b/plugins/discourse-narrative-bot/plugin.rb @@ -204,7 +204,7 @@ after_initialize do end self.add_model_callback(PostAction, :after_commit, on: :create) do - if self.user.enqueue_narrative_bot_job? + if self.post && self.user.enqueue_narrative_bot_job? input = case self.post_action_type_id when *PostActionType.flag_types_without_custom.values