diff --git a/plugins/cache/panels_hash_cache.inc b/plugins/cache/panels_hash_cache.inc
index 56e5f05..947889b 100644
--- a/plugins/cache/panels_hash_cache.inc
+++ b/plugins/cache/panels_hash_cache.inc
@@ -146,7 +146,10 @@ function panels_hash_cache_get_id($conf, $display, $args, $contexts, $pane) {
   if ($conf['granularity']['user']) {
     // For the user we hash on their UID, username, email and roles. In D7 we will have an "updated" timestamp to hash on
     global $user;
-    $hashable_string .= $user->uid . $user->name . $user->mail . serialize($user->roles);
+    $hashable_string .= $user->uid;
+    if (user_is_logged_in()) {
+      $hashable_string .= $user->name . $user->mail . serialize($user->roles);
+    }
   }
   if ($conf['granularity']['user_role']) {
     global $user;
