summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/matcher/vm.lua30
1 files changed, 21 insertions, 9 deletions
diff --git a/server/src/matcher/vm.lua b/server/src/matcher/vm.lua
index b9907804..f2494432 100644
--- a/server/src/matcher/vm.lua
+++ b/server/src/matcher/vm.lua
@@ -1087,12 +1087,14 @@ function mt:doFunction(action)
local name = action.name
local var, object
local source
- if name.type == 'simple' then
- var, object = self:getSimple(name, 'field')
- source = name[#name]
- else
- var = self:getName(name[1], name)
- source = name
+ if name then
+ if name.type == 'simple' then
+ var, object = self:getSimple(name, 'field')
+ source = name[#name]
+ else
+ var = self:getName(name[1], name)
+ source = name
+ end
end
local func = self:buildFunction(action, object)
self:setValue(var, func, source)
@@ -1100,9 +1102,19 @@ end
function mt:doLocalFunction(action)
local name = action.name
- local var = self:createLocal(name[1], name)
- local func = self:buildFunction(action)
- self:setValue(var, func, name)
+ local var, object
+ local source
+ if name then
+ if name.type == 'simple' then
+ var, object = self:getSimple(name, 'field')
+ source = name[#name]
+ else
+ var = self:createLocal(name[1], name)
+ source = name
+ end
+ end
+ local func = self:buildFunction(action, object)
+ self:setValue(var, func, source)
end
function mt:doAction(action)