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