about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-10-24 11:44:29 +0000
committerEric Wong <e@80x24.org>2023-10-24 20:04:29 +0000
commit5061fda82a5df67f12b0b392bdad481cc07aa283 (patch)
tree32432c663fcafe41d22877880a0734b628176737 /lib/PublicInbox
parent9c22e8be762a8bf8a72eb8d510bc8b3e7362f6bb (diff)
downloadpublic-inbox-5061fda82a5df67f12b0b392bdad481cc07aa283.tar.gz
We need to gracefully continue when a user tries to associate
with --all but has basic (or completely unindexed) inboxes.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/CodeSearchIdx.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/PublicInbox/CodeSearchIdx.pm b/lib/PublicInbox/CodeSearchIdx.pm
index 2d1d8b22..c8e4c591 100644
--- a/lib/PublicInbox/CodeSearchIdx.pm
+++ b/lib/PublicInbox/CodeSearchIdx.pm
@@ -551,12 +551,14 @@ sub dump_roots_start {
 sub dump_ibx { # sends to xap_helper.h
         my ($self, $ibx_id) = @_;
         my $ibx = $IBX[$ibx_id] // die "BUG: no IBX[$ibx_id]";
-        my @cmd = ('dump_ibx', $ibx->isrch->xh_args,
-                        (map { ('-A', $_) } @ASSOC_PFX),
-                        $ibx_id, $QRY_STR);
+        my $ekey = $ibx->eidx_key;
+        my $srch = $ibx->isrch or return warn <<EOM;
+W: $ekey not indexed for search
+EOM
+        my @cmd = ('dump_ibx', $srch->xh_args,
+                        (map { ('-A', $_) } @ASSOC_PFX), $ibx_id, $QRY_STR);
         pipe(my $r, my $w);
         $XHC->mkreq([$DUMP_IBX_WPIPE, $w], @cmd);
-        my $ekey = $ibx->eidx_key;
         $self->{PENDING}->{$ekey} = $TODO{associate};
         PublicInbox::CidxXapHelperAux->new($r, $self, $ekey);
 }