about summary refs log tree commit homepage
path: root/lib/PublicInbox/View.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/View.pm')
-rw-r--r--lib/PublicInbox/View.pm4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index d897aeec..9ef1f68a 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -504,9 +504,6 @@ sub attach_link ($$$$;$) {
         # spotting MUA problems:
         $ct =~ s/;.*// unless $err;
         $ct = ascii_html($ct);
-        my $desc = $part->header('Content-Description');
-        $desc = $fn unless defined $desc;
-        $desc = '' unless defined $desc;
         my $sfn;
         if (defined $fn && $fn =~ /\A$PublicInbox::Hval::FN\z/o) {
                 $sfn = $fn;
@@ -524,6 +521,7 @@ EOF
         }
         $$rv .= "[-- Attachment #$idx: ";
         my $ts = "Type: $ct, Size: $size bytes";
+        my $desc = $part->header('Content-Description') // $fn // '';
         $desc = ascii_html($desc);
         $$rv .= ($desc eq '') ? "$ts --]" : "$desc --]\n[-- $ts --]";
         $$rv .= "</a>\n";