From 3d8e1afc8918bc87fd916853e2c809a37a8f003b Mon Sep 17 00:00:00 2001 From: Nikolay Vznuzdaev Date: Thu, 23 Apr 2015 14:29:31 +0300 Subject: [PATCH] Gender and link fields in google response are optional, prevent nil mapping. --- .../GoogleWeb/SimpleAuthGoogleWebProvider.m | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Pod/Providers/GoogleWeb/SimpleAuthGoogleWebProvider.m b/Pod/Providers/GoogleWeb/SimpleAuthGoogleWebProvider.m index 3bf070d..d374625 100644 --- a/Pod/Providers/GoogleWeb/SimpleAuthGoogleWebProvider.m +++ b/Pod/Providers/GoogleWeb/SimpleAuthGoogleWebProvider.m @@ -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;