From a876d098fe885085b4095089f6a1ab8b0b2ad9a6 Mon Sep 17 00:00:00 2001 From: artisticMink Date: Sat, 4 Nov 2023 21:27:02 +0100 Subject: [PATCH] Skip handleDeleteCharacter when character is undefined --- public/script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/script.js b/public/script.js index c3fa71968..900ce24d9 100644 --- a/public/script.js +++ b/public/script.js @@ -7207,7 +7207,8 @@ function doCloseChat() { * @param {boolean} delete_chats - Whether to delete chats or not. */ export async function handleDeleteCharacter(popup_type, this_chid, delete_chats) { - if (popup_type !== "del_ch") { + if (popup_type !== "del_ch" || + !characters[this_chid]) { return; }