add safety check
This commit is contained in:
parent
86217d121e
commit
dad7fc8fc4
|
@ -188,11 +188,12 @@ impl ChatDB {
|
|||
}
|
||||
}
|
||||
for (index, label) in changes {
|
||||
vector.remove(index);
|
||||
vector.splice(index..index, include_db[&label].iter().cloned());
|
||||
if index < vector.len() {
|
||||
vector.remove(index);
|
||||
vector.splice(index..index, include_db[&label].iter().cloned());
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
pub fn get_chat_by_id(&self, id: &String) -> Result<usize, String> {
|
||||
|
|
Loading…
Reference in a new issue