From 76b98cbed432aa331de60128321ca68aa926f69a Mon Sep 17 00:00:00 2001 From: Pranav Raj S Date: Sun, 10 May 2020 22:20:45 +0530 Subject: [PATCH] Bug: Fix inbox.agent_bot nil case (#841) --- app/views/widgets/show.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/widgets/show.html.erb b/app/views/widgets/show.html.erb index 571d86919..7602074d7 100644 --- a/app/views/widgets/show.html.erb +++ b/app/views/widgets/show.html.erb @@ -8,7 +8,9 @@ window.chatwootWebChannel = { avatarUrl: '<%= @web_widget.inbox.avatar_url %>', hasAConnectedAgentBot: '<%= @web_widget.inbox.agent_bot&.name %>', - hideInputForBotConversations: <%= ActiveModel::Type::Boolean.new.cast(@web_widget.inbox.agent_bot&.hide_input_for_bot_conversations) %>, + <% if @web_widget.inbox.agent_bot %> + hideInputForBotConversations: <%= @web_widget.inbox.agent_bot.hide_input_for_bot_conversations %>, + <% end %> locale: '<%= @web_widget.account.locale %>', websiteName: '<%= @web_widget.inbox.name %>', websiteToken: '<%= @web_widget.website_token %>',