mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-02 02:47:52 +01:00
Fix bug with undefined char on empty chats
This commit is contained in:
parent
57bbd349a0
commit
8e445c75ae
@ -2139,7 +2139,7 @@ export function findChar({ name = null, allowAvatar = true, insensitive = true,
|
||||
// Get the current character(s)
|
||||
/** @type {any[]} */
|
||||
const currentChars = selected_group ? groups.find(group => group.id === selected_group)?.members.map(member => filteredCharacters.find(char => char.avatar === member))
|
||||
: [filteredCharacters.find(char => characters[this_chid]?.avatar === char.avatar)];
|
||||
: filteredCharacters.filter(char => characters[this_chid]?.avatar === char.avatar);
|
||||
|
||||
// If we have a current char and prefer it, return that if it matches
|
||||
if (preferCurrentChar) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user