diff --git a/src/dc_receive_imf.rs b/src/dc_receive_imf.rs index 53f6d3e54..9a2e5a448 100644 --- a/src/dc_receive_imf.rs +++ b/src/dc_receive_imf.rs @@ -1724,7 +1724,7 @@ fn search_chat_ids_by_contact_ids(context: &Context, unsorted_contact_ids: &Vec< matches = 0; mismatches = 0; } - if contact_id == contact_ids[matches] { + if matches < contact_ids.len() && contact_id == contact_ids[matches] { matches += 1; } else { mismatches += 1;