Do not allow empty or undefined variable names.

Closes #3204
This commit is contained in:
Cohee
2024-12-18 20:22:27 +02:00
parent 00363cc206
commit 372ac26080
2 changed files with 9 additions and 1 deletions

View File

@ -46,6 +46,10 @@ function getLocalVariable(name, args = {}) {
}
function setLocalVariable(name, value, args = {}) {
if (!name) {
throw new Error('Variable name cannot be empty or undefined.');
}
if (!chat_metadata.variables) {
chat_metadata.variables = {};
}