fix: crash on empty search
This commit is contained in:
parent
f35ad27627
commit
eb0b2c429f
2 changed files with 20 additions and 18 deletions
|
@ -44,11 +44,12 @@ pub async fn search_events_route(
|
|||
));
|
||||
}
|
||||
|
||||
let search = db
|
||||
if let Some(search) = db
|
||||
.rooms
|
||||
.search_pdus(&room_id, &search_criteria.search_term)?;
|
||||
|
||||
searches.push(search.0.peekable());
|
||||
.search_pdus(&room_id, &search_criteria.search_term)?
|
||||
{
|
||||
searches.push(search.0.peekable());
|
||||
}
|
||||
}
|
||||
|
||||
let skip = match body.next_batch.as_ref().map(|s| s.parse()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue