From d9e0d49f0651af1eed81db55e4571cc1a422a5af Mon Sep 17 00:00:00 2001 From: droid Date: Fri, 4 Oct 2024 09:41:00 +0200 Subject: [PATCH] fix: Handle missing email in Facebook login --- .../org/openedx/auth/presentation/sso/FacebookAuthHelper.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/auth/src/main/java/org/openedx/auth/presentation/sso/FacebookAuthHelper.kt b/auth/src/main/java/org/openedx/auth/presentation/sso/FacebookAuthHelper.kt index 70f2209ab..f6e734629 100644 --- a/auth/src/main/java/org/openedx/auth/presentation/sso/FacebookAuthHelper.kt +++ b/auth/src/main/java/org/openedx/auth/presentation/sso/FacebookAuthHelper.kt @@ -46,8 +46,8 @@ class FacebookAuthHelper { continuation.safeResume( SocialAuthResponse( accessToken = result.accessToken.token, - name = obj?.getString(ApiConstants.NAME) ?: "", - email = obj?.getString(ApiConstants.EMAIL) ?: "", + name = obj?.optString(ApiConstants.NAME).orEmpty(), + email = obj?.optString(ApiConstants.EMAIL).orEmpty(), authType = AuthType.FACEBOOK, ) ) {