avoid crash when chat "include" label doesn't exist

This commit is contained in:
yuni 2024-04-14 15:37:23 +02:00
parent 600f9d5e3e
commit 7b6b14a992

View file

@ -190,7 +190,9 @@ impl ChatDB {
for (index, label) in changes {
if index < vector.len() {
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());
}
}
}
}