about summary refs log tree commit homepage
path: root/lib/PublicInbox/Inbox.pm
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-29 09:57:44 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-03-29 09:59:50 +0000
commit6efc0df8d3e00da0257b131e96f74d18fce290ab (patch)
tree287182a9d4f8b47375cac2351da650703ea040b4 /lib/PublicInbox/Inbox.pm
parent7b5ea579e6a9490a4a38958acac8e078d805eec7 (diff)
downloadpublic-inbox-6efc0df8d3e00da0257b131e96f74d18fce290ab.tar.gz
We do not need to care about ghosts at multiple call sites; they
cannot have a {blob} field and we've stored the blob field in
Xapian since SCHEMA_VERSION=13.
Diffstat (limited to 'lib/PublicInbox/Inbox.pm')
-rw-r--r--lib/PublicInbox/Inbox.pm10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index 30977514..47b86309 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -270,12 +270,10 @@ sub msg_by_path ($$;$) {
 sub msg_by_smsg ($$;$) {
         my ($self, $smsg, $ref) = @_;
 
-        return unless defined $smsg; # ghost
-
-        # backwards compat to fallback to msg_by_mid
-        # TODO: remove if we bump SCHEMA_VERSION in Search.pm:
-        defined(my $blob = $smsg->{blob}) or
-                        return msg_by_path($self, mid2path($smsg->mid), $ref);
+        # ghosts may have undef smsg (from SearchThread.node) or
+        # no {blob} field (from each_smsg_by_mid)
+        return unless defined $smsg;
+        defined(my $blob = $smsg->{blob}) or return;
 
         my $str = git($self)->cat_file($blob, $ref);
         $$str =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s if $str;