summaryrefslogtreecommitdiffstats
path: root/acf2/persistence/backends
diff options
context:
space:
mode:
Diffstat (limited to 'acf2/persistence/backends')
-rw-r--r--acf2/persistence/backends/augeas.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/acf2/persistence/backends/augeas.lua b/acf2/persistence/backends/augeas.lua
index 620a393..7078fe9 100644
--- a/acf2/persistence/backends/augeas.lua
+++ b/acf2/persistence/backends/augeas.lua
@@ -106,12 +106,14 @@ function backend:set(mods)
if #self.aug:match(mpath) == 0 then
local function order(path)
- return topology('/augeas'..path).order
+ local top = topology('/augeas'..path)
+ return top and top.order
end
local ord = order(pth.join('/', unpack(path)))
for _, sibling in ipairs(self.aug:match(pth.parent(mpath)..'/*')) do
- if order(strip_name(sibling):sub(7, -1)) > ord then
+ local sord = order(strip_name(sibling):sub(7, -1))
+ if sord and sord > ord then
self.aug:insert(sibling, pth.name(mpath), true)
break
end