Fix undefined array access for CFG prompt
| @@ -4467,6 +4467,9 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro | ||
| 4467 | 4467 | // TODO: Make all extension prompts use an array/splice method |
| 4468 | 4468 | const lengthDiff = mesSend.length - cfgPrompt.depth; |
| 4469 | 4469 | const cfgDepth = lengthDiff >= 0 ? lengthDiff : 0; |
| 4470 | + if (!Array.isArray(finalMesSend[cfgDepth].extensionPrompts)) { | |
| 4471 | + finalMesSend[cfgDepth].extensionPrompts = []; | |
| 4472 | + } | |
| 4470 | 4473 | finalMesSend[cfgDepth].extensionPrompts.push(`${cfgPrompt.value}\n`); |
| 4471 | 4474 | } |
| 4472 | 4475 | } |