From: Eric Wong Date: Sun, 26 Jun 2016 23:41:00 +0000 (+0000) Subject: inbox: avoid trying s// on undef X-Git-Tag: v1.0.0~351 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=62e690b87d03ab1fa1829f99e37c63707c64a5c4 inbox: avoid trying s// on undef Oops, I guess I'm trigger-happy today. Fixes: 31a6ff1221fe ("inbox: ensure we do not show leading "From " lines") --- diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 87c2c9fc..ada713c7 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -100,7 +100,7 @@ sub msg_by_path ($$;$) { my ($self, $path, $ref) = @_; # TODO: allow other refs: my $str = git($self)->cat_file('HEAD:'.$path, $ref); - $$str =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s; + $$str =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s if $str; $str; }