From 8e445c75ae706cc636cb6e7b306a695985fc48d0 Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Sun, 29 Sep 2024 13:38:15 +0200 Subject: [PATCH] Fix bug with undefined char on empty chats --- public/scripts/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/scripts/utils.js b/public/scripts/utils.js index 9ddd0413c..93c752a9c 100644 --- a/public/scripts/utils.js +++ b/public/scripts/utils.js @@ -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) {