diff options
Diffstat (limited to 'acf2/model/node.lua')
-rw-r--r-- | acf2/model/node.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/acf2/model/node.lua b/acf2/model/node.lua index d0d44cd..85a857d 100644 --- a/acf2/model/node.lua +++ b/acf2/model/node.lua @@ -125,8 +125,11 @@ function M.TreeNode:fetch(path, create) raise(mt.path, 'Member does not exist: '..name) end - local options = {create=create} - if create and #path == 1 then options.dereference = false end + local options = {} + if create then + options.create = true + if #path == 1 then options.dereference = false end + end local next = mt.get(name, options) if next == nil and (not create or #path > 1) then raise(mt.path, 'Subordinate does not exist: '..name) @@ -332,7 +335,7 @@ end local function _ipairs(mt, i) i = i + 1 - local v = mt.load(i) + local v = mt.load(i, {create=false}) if v == nil then return end return i, v end |