diff --git a/src/chatlist.rs b/src/chatlist.rs index e15400f1d..9e1e82ed4 100644 --- a/src/chatlist.rs +++ b/src/chatlist.rs @@ -251,7 +251,7 @@ impl Chatlist { /// /// To get the message object from the message ID, use dc_get_msg(). pub fn get_msg_id(&self, index: usize) -> Result { - ensure!(index >= self.ids.len(), "Chatlist index out of range"); + ensure!(index < self.ids.len(), "Chatlist index out of range"); Ok(self.ids[index].1) }