diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index bcab078e4..5d9ae3ecc 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -2580,8 +2580,8 @@ async function checkWorldInfo(chat, maxContext) { } }); - const worldInfoBefore = WIBeforeEntries.join('\n'); - const worldInfoAfter = WIAfterEntries.join('\n'); + const worldInfoBefore = WIBeforeEntries.length ? WIBeforeEntries.join('\n') : ''; + const worldInfoAfter = WIAfterEntries.length ? WIAfterEntries.join('\n') : ''; if (shouldWIAddPrompt) { const originalAN = context.extensionPrompts[NOTE_MODULE_NAME].value;