Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Fix google provider crash on empty gender/link fields #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Pod/Providers/GoogleWeb/SimpleAuthGoogleWebProvider.m
Original file line number Diff line number Diff line change
Expand Up @@ -177,16 +177,20 @@ - (NSDictionary *)dictionaryWithAccount:(NSDictionary *)account
user[@"name"] = account[@"name"];
user[@"first_name"] = account[@"given_name"];
user[@"last_name"] = account[@"family_name"];
user[@"gender"] = account[@"gender"];
if (account[@"gender"]) {
user[@"gender"] = account[@"gender"];
}

user[@"image"] = account[@"picture"];
if (location) {
user[@"location"] = location;
}
user[@"verified"] = account[@"verified_email"] ? @YES : @NO;
user[@"urls"] = @{
@"Google +" : account[@"link"],
};
if (account[@"link"]) {
user[@"urls"] = @{
@"Google +" : account[@"link"],
};
}

dictionary[@"info"] = user;

Expand Down