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 = {}) {
103103}
104104
105105function setGlobalVariable(name, value, args = {}) {
106+ if (!name) {
107+ throw new Error('Variable name cannot be empty or undefined.');
108+ }
109+
106110 if (args.index !== undefined) {
107111 try {
108112 let globalVariable = JSON.parse(extension_settings.variables.global[name] ?? 'null');