about summary refs log tree commit homepage
path: root/lib/PublicInbox/ContentDigestDbg.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-04-28 09:43:27 +0000
committerEric Wong <e@80x24.org>2023-04-28 22:59:01 +0000
commit0f3b7b6058cc4b667e6fbd967d882ad8c47de288 (patch)
tree8c1420a8f5380b7ab53d2dc46b708c4bb5ac55e0 /lib/PublicInbox/ContentDigestDbg.pm
parentc791fd9ecc60b7bd6f41b18f928279f8df5cc733 (diff)
downloadpublic-inbox-0f3b7b6058cc4b667e6fbd967d882ad8c47de288.tar.gz
It's possible that we hit messages or attachments with empty
bodies, so avoid doing a regexp match on an uninitialized variable.
Diffstat (limited to 'lib/PublicInbox/ContentDigestDbg.pm')
-rw-r--r--lib/PublicInbox/ContentDigestDbg.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/ContentDigestDbg.pm b/lib/PublicInbox/ContentDigestDbg.pm
index 31d0f707..853624f1 100644
--- a/lib/PublicInbox/ContentDigestDbg.pm
+++ b/lib/PublicInbox/ContentDigestDbg.pm
@@ -11,7 +11,7 @@ sub new { bless [ PublicInbox::SHA->new(256), $_[1] ], __PACKAGE__ }
 sub add {
         $_[0]->[0]->add($_[1]);
         my @dbg = split(/^/sm, $_[1]);
-        if ($dbg[0] =~ /\A(To|Cc)\0/) { # fold excessively long lines
+        if (@dbg && $dbg[0] =~ /\A(To|Cc)\0/) { # fold excessively long lines
                 @dbg = map { split(/,/s, $_) } @dbg;
         }
         print { $_[0]->[1] } Dumper(\@dbg) or die "print $!";