From cbb1f54ffd02045745d31b00b404a64a6babbc71 Mon Sep 17 00:00:00 2001 From: Mohamed El-Sawy Date: Mon, 1 Jul 2024 19:43:25 +0300 Subject: [PATCH] CV2-4799 & CV2-4799 sentry issues (#1939) * CV2-4799: sentry issue * CV2-4832: sentry issue --- app/mailers/feed_invitation_mailer.rb | 1 + app/models/concerns/smooch_menus.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/mailers/feed_invitation_mailer.rb b/app/mailers/feed_invitation_mailer.rb index ff5540fdb5..1a2a700007 100644 --- a/app/mailers/feed_invitation_mailer.rb +++ b/app/mailers/feed_invitation_mailer.rb @@ -3,6 +3,7 @@ class FeedInvitationMailer < ApplicationMailer def notify(record_id) record = FeedInvitation.find_by_id record_id + return if record.nil? @recipient = record.email @user = record.user @feed = record.feed diff --git a/app/models/concerns/smooch_menus.rb b/app/models/concerns/smooch_menus.rb index 5cf8e59590..5eaed6eb2c 100644 --- a/app/models/concerns/smooch_menus.rb +++ b/app/models/concerns/smooch_menus.rb @@ -19,7 +19,7 @@ def send_message_to_user_with_main_menu_appended(uid, text, workflow, language, allowed_types = ['query_state', 'subscription_state', 'custom_resource'] ['smooch_state_main', 'smooch_state_secondary'].each_with_index do |state, i| rows = [] - options = workflow[state].to_h['smooch_menu_options'].to_a + options = begin workflow[state].to_h['smooch_menu_options'].to_a rescue [] end next if options.empty? options.select{ |o| allowed_types.include?(o['smooch_menu_option_value']) }.each do |option| title = option['smooch_menu_option_label']