about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-08-28 02:15:08 +0000
committerEric Wong <e@80x24.org>2014-08-28 02:47:11 +0000
commite3884bc14d2540192ec065a8b082fc9d0f68f343 (patch)
tree0d40d06b62eb2ef5907891683a7519febfe6b671 /lib
parentc5d457c20c4ac43b877221b23ad6b2dbdf3b6d75 (diff)
downloadpublic-inbox-e3884bc14d2540192ec065a8b082fc9d0f68f343.tar.gz
Sometimes we get spam and need to delete messages,
we must prevent errors on missing messages from propagating.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Feed.pm7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm
index 1eaba6c2..646c85c9 100644
--- a/lib/PublicInbox/Feed.pm
+++ b/lib/PublicInbox/Feed.pm
@@ -291,8 +291,11 @@ sub dump_msg {
 
 sub do_cat_mail {
         my ($git, $path) = @_;
-        my $str = $git->cat_file("HEAD:$path");
-        Email::MIME->new($str);
+        my $mime = eval {
+                my $str = $git->cat_file("HEAD:$path");
+                Email::MIME->new($str);
+        };
+        $@ ? undef : $mime;
 }
 
 1;