From f39df11b625a317b66bd41aa1cc8292d978d41b6 Mon Sep 17 00:00:00 2001 From: William Astorga <53057769+wastorga@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:34:50 -0600 Subject: [PATCH] Make info's phone optional By making phoneNumbers optional, it avoids NoMethodError for nil:NilClass errors, from Webex accounts that do not have a phone number configured. --- lib/omniauth/strategies/webex.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/omniauth/strategies/webex.rb b/lib/omniauth/strategies/webex.rb index f3ecaac..b327f3d 100644 --- a/lib/omniauth/strategies/webex.rb +++ b/lib/omniauth/strategies/webex.rb @@ -30,7 +30,7 @@ def authorize_params 'nickname' => raw_info['nickName'], 'first_name' => raw_info['firstName'], 'last_name' => raw_info['lastName'], - 'phone' => raw_info['phoneNumbers'].first + 'phone' => raw_info['phoneNumbers']&.first } end