summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/vm/eachDef.lua3
-rw-r--r--script/vm/eachField.lua3
-rw-r--r--script/vm/eachRef.lua3
3 files changed, 9 insertions, 0 deletions
diff --git a/script/vm/eachDef.lua b/script/vm/eachDef.lua
index 7825d2b1..8d031f42 100644
--- a/script/vm/eachDef.lua
+++ b/script/vm/eachDef.lua
@@ -33,6 +33,9 @@ function vm.getDefs(source, deep)
deep = deep or -999
if guide.isGlobal(source) then
local key = guide.getKeyName(source)
+ if not key then
+ return {}
+ end
return vm.getGlobalSets(key)
else
local cache = vm.getCache('eachDef')[source]
diff --git a/script/vm/eachField.lua b/script/vm/eachField.lua
index 2620aa41..7c5c98f8 100644
--- a/script/vm/eachField.lua
+++ b/script/vm/eachField.lua
@@ -44,6 +44,9 @@ function vm.getFields(source, deep)
end
if guide.isGlobal(source) then
local name = guide.getKeyName(source)
+ if not name then
+ return {}
+ end
local cache = vm.getCache('eachFieldOfGlobal')[name]
or getFieldsBySource(source, deep)
vm.getCache('eachFieldOfGlobal')[name] = cache
diff --git a/script/vm/eachRef.lua b/script/vm/eachRef.lua
index e9229c38..1073ecbe 100644
--- a/script/vm/eachRef.lua
+++ b/script/vm/eachRef.lua
@@ -32,6 +32,9 @@ function vm.getRefs(source, deep)
deep = deep or -999
if guide.isGlobal(source) then
local key = guide.getKeyName(source)
+ if not key then
+ return {}
+ end
return vm.getGlobals(key)
else
local cache = vm.getCache('eachRef')[source]