This repository was archived by the owner on Apr 4, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -1107,15 +1107,17 @@ function toLoginResult(user) {
11071107 }
11081108
11091109 const providers = [ ] ;
1110- for ( let i = 0 , l = user . providerData . count ; i < l ; i ++ ) {
1111- const firUserInfo = user . providerData . objectAtIndex ( i ) ;
1112- const pid = firUserInfo . valueForKey ( "providerID" ) ;
1113- // the app may have dropped Facebook support, so check if the native class is still there
1114- if ( pid === 'facebook.com' && typeof ( FBSDKAccessToken ) !== "undefined" ) { // FIRFacebookAuthProviderID
1115- const fbCurrentAccessToken = FBSDKAccessToken . currentAccessToken ( ) ;
1116- providers . push ( { id : pid , token : fbCurrentAccessToken ? fbCurrentAccessToken . tokenString : null } ) ;
1117- } else {
1118- providers . push ( { id : pid } ) ;
1110+ if ( user . providerData ) {
1111+ for ( let i = 0 , l = user . providerData . count ; i < l ; i ++ ) {
1112+ const firUserInfo = user . providerData . objectAtIndex ( i ) ;
1113+ const pid = firUserInfo . valueForKey ( "providerID" ) ;
1114+ // the app may have dropped Facebook support, so check if the native class is still there
1115+ if ( pid === 'facebook.com' && typeof ( FBSDKAccessToken ) !== "undefined" ) { // FIRFacebookAuthProviderID
1116+ const fbCurrentAccessToken = FBSDKAccessToken . currentAccessToken ( ) ;
1117+ providers . push ( { id : pid , token : fbCurrentAccessToken ? fbCurrentAccessToken . tokenString : null } ) ;
1118+ } else {
1119+ providers . push ( { id : pid } ) ;
1120+ }
11191121 }
11201122 }
11211123
You can’t perform that action at this time.
0 commit comments