From 9114b5dbc693f4d68d246ab4ed19c2b569f2bb66 Mon Sep 17 00:00:00 2001
From: Tim Steiner <tsteiner2@unl.edu>
Date: Fri, 22 Oct 2010 19:41:38 +0000
Subject: [PATCH] Prevent a warning message when trying to access the user
 image of the anonymous user.

git-svn-id: file:///tmp/wdn_thm_drupal/trunk@258 20a16fea-79d4-4915-8869-1ea9d5ebf173
---
 sites/all/modules/unl/unl_cas.module | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sites/all/modules/unl/unl_cas.module b/sites/all/modules/unl/unl_cas.module
index 339d9e6e..167e24bf 100644
--- a/sites/all/modules/unl/unl_cas.module
+++ b/sites/all/modules/unl/unl_cas.module
@@ -165,7 +165,11 @@ function unl_cas_import_user($username) {
 }
 
 function unl_cas_preprocess_user_picture(&$variables) {
-  //Default image: http://planetred.unl.edu/mod/profile/graphics/defaulttopbar.gif
+  //Default image: http://planetred.unl.edu/mod/profile/graphics/defaultmedium.gif
+  if ($variables['account']->uid == 0) {
+    $variables['user_picture'] = 'http://planetred.unl.edu/mod/profile/graphics/defaultmedium.gif';
+    return;
+  }
   $username = $variables['account']->name;
   $variables['user_picture'] = '<img class="profile_pic medium" src="http://planetred.unl.edu/pg/icon/unl_' . $username . '/medium" alt="' . $username . '\'s photo" />';
 }
-- 
GitLab