--- modules/contact/views_handler_field_contact_link.inc.1.2.2.2	Sat Jul 18 09:01:50 2009
+++ modules/contact/views_handler_field_contact_link.inc	Sat Jul 18 09:38:50 2009
@@ -4,7 +4,7 @@
  * A field that links to the user contact page, if access is permitted.
  */
 class views_handler_field_contact_link extends views_handler_field_user_link {
-  
+
   function option_definition() {
     $options = parent::option_definition();
     $options['link_display'] = array('default' => 'link', 'translatable' => FALSE);
@@ -31,13 +31,11 @@ class views_handler_field_contact_link e
     global $user;
     $uid = $values->{$this->aliases['uid']};
     $account = user_load(array('uid' => $uid));
-    
-    // Check access when we pull up the user account so we know
-    // if the user has made the contact page available.
-    if (! _contact_user_tab_access($account)) {
-      return;
-    }
-    if ($account !== FALSE && $account->contact && $user->uid > 0) {
+
+    // Check access when we pull up the user account so we know if the user
+    // has made the contact page available. Note that _contact_user_tab_access
+    // doesn't work on the anonymous user account. 
+    if ($account->uid && _contact_user_tab_access($account)) {
       if ($this->options['link_display'] == 'icon') {
         return l(theme('image', 'misc/forum-new.png'), 'user/'. $account->uid .'/contact', array('html' => TRUE, 'attributes' => array('title' => t('Contact %user', array('%user' => $account->name)))));
       }
@@ -47,4 +45,3 @@ class views_handler_field_contact_link e
     }
   }
 }
-
