1
0
mirror of https://github.com/SillyTavern/SillyTavern.git synced 2025-03-30 11:50:09 +02:00

Also check global variable names

This commit is contained in:
Cohee 2024-12-19 19:15:04 +02:00
parent 372ac26080
commit d5ed0f6cdf

@ -103,6 +103,10 @@ function getGlobalVariable(name, args = {}) {
}
function setGlobalVariable(name, value, args = {}) {
if (!name) {
throw new Error('Variable name cannot be empty or undefined.');
}
if (args.index !== undefined) {
try {
let globalVariable = JSON.parse(extension_settings.variables.global[name] ?? 'null');