fix: guard against nil contact in conversation jbuilder partial
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user