Fixed ShowEmail
authorAndrew DeFaria <A.DeFaria@cpanel.net>
Wed, 25 Jan 2023 19:50:41 +0000 (11:50 -0800)
committerAndrew DeFaria <A.DeFaria@cpanel.net>
Wed, 25 Jan 2023 19:50:41 +0000 (11:50 -0800)
maps/bin/mapsutil.pl

index 15488fd..fba892b 100755 (executable)
@@ -374,10 +374,11 @@ $~ = "USERLIST";
 } # ShowUsers
 
 sub ShowEmail() {
+  my @fields = qw(userid timestamp sender subject);
   my ($err, $msg) = $MAPS::db->find(
     'email',
     "userid='$userid'",
-    qw(userid timestamp sender subject),
+    \@fields,
   );
 
 my ($timestamp, $sender, $subject);
@@ -391,9 +392,9 @@ $~ = "EMAIL";
   while (my $rec = $MAPS::db->getnext) {
     last unless $rec->{userid};
 
-   $timestamp = $rec->{timestamp};
-   $sender    = $rec->{sender};
-   $subject   = $rec->{subject};
+   $timestamp = $rec->{timestamp} || '<undef>';
+   $sender    = $rec->{sender}    || '<undef>';
+   $subject   = $rec->{subject}   || '<undef>';
 
     write();
   } # while