Merge branch 'master' of https://github.com/jgoodman/Freeside
[freeside.git] / rt / share / html / Elements / ShowUserVerbose
index 9ff8cbb..3276228 100644 (file)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
@@ -54,8 +54,9 @@ my $comment = '';
 
 if ($User) {
     $address = $User->EmailAddress;
-    $phrase  = $User->RealName if $User->RealName && lc $User->RealName ne lc $address;
-    $comment = $User->Name if lc $User->Name ne lc $address;
+    $phrase = $User->RealName
+      if $User->RealName && ( !$address || lc $User->RealName ne lc $address );
+    $comment = $User->Name if !$address || lc $User->Name ne lc $address;
 } else {
     $address = $Address;
 }