Also check global variable names

d5ed0f6cdfee4026c81f16beb58d757840332350

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -0Showing whitespace changes
public/scripts/variables.js+4 -0
@@ -103,6 +103,10 @@ function getGlobalVariable(name, args = {}) {
103}103}
104104
105function setGlobalVariable(name, value, args = {}) {105function setGlobalVariable(name, value, args = {}) {
106 if (!name) {
107 throw new Error('Variable name cannot be empty or undefined.');
108 }
109
106 if (args.index !== undefined) {110 if (args.index !== undefined) {
107 try {111 try {
108 let globalVariable = JSON.parse(extension_settings.variables.global[name] ?? 'null');112 let globalVariable = JSON.parse(extension_settings.variables.global[name] ?? 'null');