From 83e75439abd84ab6433d7070b530c0ad04d08211 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Fri, 28 Feb 2025 10:21:33 +0200 Subject: [PATCH] Fix duplication and scenario override for first in the list --- public/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/script.js b/public/script.js index 6cd16d6de..859730359 100644 --- a/public/script.js +++ b/public/script.js @@ -5309,7 +5309,7 @@ function addChatsSeparator(mesSendString) { } async function duplicateCharacter() { - if (!this_chid) { + if (this_chid === undefined || !characters[this_chid]) { toastr.warning(t`You must first select a character to duplicate!`); return ''; } @@ -7883,7 +7883,7 @@ function updateFavButtonState(state) { } export async function setScenarioOverride() { - if (!selected_group && !this_chid) { + if (!selected_group && (this_chid === undefined || !characters[this_chid])) { console.warn('setScenarioOverride() -- no selected group or character'); return; }