]> Sergey Matveev's repositories - public-inbox.git/commitdiff
inbox: deal with ghost smsg
authorEric Wong <e@80x24.org>
Wed, 5 Oct 2016 23:47:20 +0000 (23:47 +0000)
committerEric Wong <e@80x24.org>
Wed, 5 Oct 2016 23:52:43 +0000 (23:52 +0000)
smsg will be undef for ghost messages in a subsequent commit

lib/PublicInbox/Inbox.pm

index 414973c6dedd9b6137852695092877cc0b62e7a1..8c639082a4189f6ad91cb3e0ec3a2e9612bc41d2 100644 (file)
@@ -211,6 +211,8 @@ 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_mid($self, $smsg->mid);