about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiRemote.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/LeiRemote.pm')
-rw-r--r--lib/PublicInbox/LeiRemote.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/PublicInbox/LeiRemote.pm b/lib/PublicInbox/LeiRemote.pm
index 945d9990..e7deecb8 100644
--- a/lib/PublicInbox/LeiRemote.pm
+++ b/lib/PublicInbox/LeiRemote.pm
@@ -26,11 +26,12 @@ sub _each_mboxrd_eml { # callback for MboxReader->mboxrd
         my ($eml, $self) = @_;
         my $lei = $self->{lei};
         my $xoids = $lei->{ale}->xoids_for($eml, 1);
+        my $smsg = bless {}, 'PublicInbox::Smsg';
         if ($lei->{sto} && !$xoids) { # memoize locally
-                $lei->{sto}->ipc_do('add_eml', $eml);
+                my $res = $lei->{sto}->ipc_do('add_eml', $eml);
+                $smsg = $res if ref($res) eq ref($smsg);
         }
-        my $smsg = bless {}, 'PublicInbox::Smsg';
-        $smsg->{blob} = $xoids ? (keys(%$xoids))[0]
+        $smsg->{blob} //= $xoids ? (keys(%$xoids))[0]
                                 : git_sha(1, $eml)->hexdigest;
         $smsg->populate($eml);
         $smsg->{mid} //= '(none)';