From 037768a3b6d0da7fc8a70190faf335fbbfe35a28 Mon Sep 17 00:00:00 2001 From: Cohee Date: Tue, 6 Jun 2023 23:40:51 +0300 Subject: [PATCH] Sanity check of chid on saving alternate greetings --- public/script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/script.js b/public/script.js index ebf095771..5cd3f0e74 100644 --- a/public/script.js +++ b/public/script.js @@ -4990,7 +4990,7 @@ async function createOrEditCharacter(e) { formData.delete('alternate_greetings'); const chid = $('.open_alternate_greetings').data('chid'); - if (Array.isArray(characters[chid]?.data?.alternate_greetings)) { + if (chid && Array.isArray(characters[chid]?.data?.alternate_greetings)) { for (const value of characters[chid].data.alternate_greetings) { formData.append('alternate_greetings', value); }