🐛 fix(processor): handle None query in eol_query
- fix issue where eol_query could return None, causing a panic - handle the None case by returning an error
This commit is contained in:
committed by
Jeremiah Russell
parent
7ab715c848
commit
7cf475ce39
@@ -37,9 +37,10 @@ impl<'a> Processor<'a> {
|
|||||||
return Err(Error::LableNotFoundInMailbox(label.to_string()));
|
return Err(Error::LableNotFoundInMailbox(label.to_string()));
|
||||||
}
|
}
|
||||||
|
|
||||||
messages_to_trash
|
let Some(query) = self.rule.eol_query() else {
|
||||||
.message_list()
|
return Err(Error::NoQueryStringCalculated(self.rule.id()));
|
||||||
.set_query(&self.rule.eol_query());
|
};
|
||||||
|
messages_to_trash.message_list().set_query(&query);
|
||||||
|
|
||||||
log::info!("{messages_to_trash:?}");
|
log::info!("{messages_to_trash:?}");
|
||||||
log::info!("Ready to run");
|
log::info!("Ready to run");
|
||||||
@@ -59,9 +60,10 @@ impl<'a> Processor<'a> {
|
|||||||
return Err(Error::LableNotFoundInMailbox(label.to_string()));
|
return Err(Error::LableNotFoundInMailbox(label.to_string()));
|
||||||
}
|
}
|
||||||
|
|
||||||
messages_to_delete
|
let Some(query) = self.rule.eol_query() else {
|
||||||
.message_list()
|
return Err(Error::NoQueryStringCalculated(self.rule.id()));
|
||||||
.set_query(&self.rule.eol_query());
|
};
|
||||||
|
messages_to_delete.message_list().set_query(&query);
|
||||||
|
|
||||||
log::info!("{messages_to_delete:?}");
|
log::info!("{messages_to_delete:?}");
|
||||||
log::info!("Ready to run");
|
log::info!("Ready to run");
|
||||||
|
|||||||
Reference in New Issue
Block a user