mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Fix undefined array access for CFG prompt
This commit is contained in:
@ -4467,6 +4467,9 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
|
||||
// TODO: Make all extension prompts use an array/splice method
|
||||
const lengthDiff = mesSend.length - cfgPrompt.depth;
|
||||
const cfgDepth = lengthDiff >= 0 ? lengthDiff : 0;
|
||||
if (!Array.isArray(finalMesSend[cfgDepth].extensionPrompts)) {
|
||||
finalMesSend[cfgDepth].extensionPrompts = [];
|
||||
}
|
||||
finalMesSend[cfgDepth].extensionPrompts.push(`${cfgPrompt.value}\n`);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user