diff --git a/realname_theme.inc b/realname_theme.inc
index 4944509..c6a688e 100644
--- a/realname_theme.inc
+++ b/realname_theme.inc
@@ -112,7 +112,7 @@ function realname_username($object, $options = array()) {
 //      $output = drupal_validate_utf8($name) ? strip_tags($name, $options['allowed_tags']) : '';
     }
   }
-  elseif ($object->name) {
+  elseif (isset($object->name)) {
     // Sometimes modules display content composed by people who are not registered
     // members of the site (e.g. mailing list or news aggregator modules).
     // This clause enables modules to display the true author of the content.
