From ffe56551ba5eb8ae7051737888f8cf29c7e926d0 Mon Sep 17 00:00:00 2001 From: Mark Kendall Date: Wed, 12 Nov 2014 12:30:00 +0000 Subject: [PATCH] Make email nullable As per the email section of https://developers.facebook.com/docs/facebook-login/permissions/v2.2 email may not necessarily be available. --- src/OAuth2/Provider/Facebook.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OAuth2/Provider/Facebook.php b/src/OAuth2/Provider/Facebook.php index 6d91f39..b5c44be 100644 --- a/src/OAuth2/Provider/Facebook.php +++ b/src/OAuth2/Provider/Facebook.php @@ -38,7 +38,7 @@ public function get_user_info(Token_Access $token) 'first_name'=> (property_exists($user, 'first_name') ? $user->first_name : null), 'last_name'=> (property_exists($user, 'last_name') ? $user->last_name : null), 'name' => $user->name, - 'email' => $user->email, + 'email' => (property_exists($user, 'email') ? $user->email : null), 'location' => !empty($user->hometown->name) ? $user->hometown->name : null, 'gender' => $user->gender, 'timezone' => $user->timezone,