diff options
-rw-r--r-- | lib/MaildirIndexer/Index/ByAddresses.rakumod | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/MaildirIndexer/Index/ByAddresses.rakumod b/lib/MaildirIndexer/Index/ByAddresses.rakumod index d9fd945..507c0e7 100644 --- a/lib/MaildirIndexer/Index/ByAddresses.rakumod +++ b/lib/MaildirIndexer/Index/ByAddresses.rakumod @@ -46,9 +46,12 @@ method add-mail(MaildirIndexer::Email:D $email, Str:D $mailbox --> Nil) { method del-path(IO:D $file, Str:D $mailbox --> Nil) { MaildirIndexer::LogTimelineSchema::Index::Rm.log: :class('ByAddresses'),:$mailbox, -> { - my Str (@addresses,) = %!addresses-for-file{$file.path}:delete or return; + # using `Str @addresses` fails when the path isn't present in + # the hash, because it tries to assign the (undefined) + # Array[Str] as a single element, instead of splatting it + my Array[Str] $addresses = %!addresses-for-file{$file.path}:delete or return; - self.account-for(@addresses,$mailbox,-1); + self.account-for($addresses,$mailbox,-1); return; } |