avoid crash when chat "include" label doesn't exist
This commit is contained in:
parent
600f9d5e3e
commit
7b6b14a992
|
@ -190,7 +190,9 @@ impl ChatDB {
|
||||||
for (index, label) in changes {
|
for (index, label) in changes {
|
||||||
if index < vector.len() {
|
if index < vector.len() {
|
||||||
vector.remove(index);
|
vector.remove(index);
|
||||||
vector.splice(index..index, include_db[&label].iter().cloned());
|
if let Some(chat) = include_db.get(&label) {
|
||||||
|
vector.splice(index..index, chat.iter().cloned());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue