summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fb_user.module16
1 files changed, 12 insertions, 4 deletions
diff --git a/fb_user.module b/fb_user.module
index a81bae0..cf32a0a 100644
--- a/fb_user.module
+++ b/fb_user.module
@@ -925,10 +925,18 @@ function _fb_user_get_uid($fbu, $fb_app = NULL) {
function fb_user_get_local_user_by_email($fbu) {
global $_fb;
if (isset($_fb) && $fbu) {
- $info = $_fb->api($fbu);
- if (isset($info['email']) &&
- ($email = $info['email'])) {
- return user_load(array('mail' => $email));
+ try {
+ $info = $_fb->api($fbu);
+ if (isset($info['email']) &&
+ ($email = $info['email'])) {
+ return user_load(array('mail' => $email));
+ }
+ }
+ catch (Exception $e) {
+ // This can occur when user logs out of facebook in another window, then returns to our site.
+ if (fb_verbose()) {
+ fb_log_exception($e, t('Failed to get facebook user email.'));
+ }
}
}
}