diff --git a/sites/all/modules/token/token.tokens.inc b/sites/all/modules/token/token.tokens.inc
index e0c0b5e..6652486 100644
--- a/sites/all/modules/token/token.tokens.inc
+++ b/sites/all/modules/token/token.tokens.inc
@@ -1211,7 +1211,7 @@ function profile_tokens($type, $tokens, array $data = array(), array $options =
     // Load profile fields if this is the global user account.
     // @see http://drupal.org/node/361471
     // @see http://drupal.org/node/967330
-    if ($account->uid == $GLOBALS['user']->uid && isset($account->timestamp)) {
+    if (isset($account->uid) && $account->uid == $GLOBALS['user']->uid && isset($account->timestamp)) {
       $profile_users = array($account->uid => $account);
       profile_user_load($profile_users);
       $account = $profile_users[$account->uid];
