diff --git a/public/scripts/slash-commands.js b/public/scripts/slash-commands.js index f018e5f9b..90bd90a6d 100644 --- a/public/scripts/slash-commands.js +++ b/public/scripts/slash-commands.js @@ -3129,7 +3129,7 @@ export async function sendMessageAs(args, text) { const character = characters.find(x => x.avatar === name) ?? characters.find(x => x.name === name); let force_avatar, original_avatar; - if (characters[this_chid] === character) { + if (this_chid !== undefined && characters[this_chid] === character) { // If the targeted character is the currently selected one in a solo chat, we don't need to force any avatars } else if (character && character.avatar !== 'none') {