fix: guard against nil contact in conversation jbuilder partial

This commit is contained in:
Tanmay Deep Sharma
2026-01-20 05:29:40 +00:00
committed by root
parent e13e3c873a
commit 78e78f6ef6
@@ -3,8 +3,12 @@
# Everywhere else we use conversation builder in partials folder
json.meta do
json.sender do
json.partial! 'api/v1/models/contact', formats: [:json], resource: conversation.contact
if conversation.contact
json.sender do
json.partial! 'api/v1/models/contact', formats: [:json], resource: conversation.contact
end
else
json.sender nil
end
json.channel conversation.inbox.try(:channel_type)
if conversation.assigned_entity.is_a?(AgentBot)