Also check global variable names

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

View File

@ -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');