File tree 1 file changed +17
-1
lines changed
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ use imap_proto::{
22
22
} ,
23
23
receiver:: Request ,
24
24
} ;
25
+ use trc:: StoreEvent ;
25
26
26
27
use super :: ImapContext ;
27
28
@@ -202,7 +203,22 @@ impl<T: SessionStream> SessionData<T> {
202
203
203
204
for ( mailbox_name, mailbox_id) in & account. mailbox_names {
204
205
if matches_pattern ( & patterns, mailbox_name) {
205
- let mailbox = account. mailbox_state . get ( mailbox_id) . unwrap ( ) ;
206
+ let mailbox = if let Some ( mailbox) = account. mailbox_state . get ( mailbox_id) {
207
+ mailbox
208
+ } else {
209
+ trc:: event!(
210
+ Store ( StoreEvent :: UnexpectedError ) ,
211
+ Details = "IMAP mailbox no longer present in account state" ,
212
+ Id = * mailbox_id,
213
+ Details = account
214
+ . mailbox_state
215
+ . keys( )
216
+ . copied( )
217
+ . map( trc:: Value :: from)
218
+ . collect:: <Vec <_>>( )
219
+ ) ;
220
+ continue ;
221
+ } ;
206
222
let mut has_recursive_match = false ;
207
223
if recursive_match {
208
224
let prefix = format ! ( "{}/" , mailbox_name) ;
You can’t perform that action at this time.
0 commit comments