From c9b63ae8ebee2366159b3ae9738ffa0e46544009 Mon Sep 17 00:00:00 2001 From: Tejaswini Chile Date: Fri, 10 Mar 2023 16:40:15 +0530 Subject: [PATCH] fix: hook exception for empty hook (#6646) --- lib/integrations/bot_processor_service.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/integrations/bot_processor_service.rb b/lib/integrations/bot_processor_service.rb index b8a8c4895..600ee4305 100644 --- a/lib/integrations/bot_processor_service.rb +++ b/lib/integrations/bot_processor_service.rb @@ -1,4 +1,5 @@ class Integrations::BotProcessorService + # TODO: In CSML processor service, the argument is agent bot, update initializers accordingly. pattr_initialize [:event_name!, :hook!, :event_data!] def perform @@ -7,7 +8,7 @@ class Integrations::BotProcessorService process_content(message) rescue StandardError => e - ChatwootExceptionTracker.new(e, account: hook.account).capture_exception + ChatwootExceptionTracker.new(e, account: (hook&.account || agent_bot&.account)).capture_exception end private