lib/PublicInbox/LEI.pm | 9 +++++---- diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index d534f1d04e8dfce9747b73efbad230c18368c220..99e180f61e9e3e4f2572bc5f98ece05356cc326e 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -701,8 +701,9 @@ my $cfg = PublicInbox::Config::git_config_dump($f); bless $cfg, 'PublicInbox::Config'; $cfg->{-st} = $cur_st; $cfg->{'-f'} = $f; - if ($sto && File::Spec->canonpath($sto_dir) eq - File::Spec->canonpath($cfg->{'leistore.dir'})) { + if ($sto && File::Spec->canonpath($sto_dir // store_path($self)) + eq File::Spec->canonpath($cfg->{'leistore.dir'} // + store_path($self))) { $cfg->{-lei_store} = $sto; } if (scalar(keys %PATH2CFG) > 5) { @@ -719,8 +720,8 @@ my ($self, $creat) = @_; my $cfg = _lei_cfg($self, $creat); $cfg->{-lei_store} //= do { require PublicInbox::LeiStore; - my $dir = $cfg->{'leistore.dir'}; - $dir //= $creat ? store_path($self) : return; + my $dir = $cfg->{'leistore.dir'} // store_path($self); + return unless $creat || -d $dir; PublicInbox::LeiStore->new($dir, { creat => $creat }); }; }