* ffluci.cbi: Fixed a problem where an error message occured when the first UCI secti...
authorSteven Barth <steven@midlink.org>
Tue, 22 Apr 2008 18:55:12 +0000 (18:55 +0000)
committerSteven Barth <steven@midlink.org>
Tue, 22 Apr 2008 18:55:12 +0000 (18:55 +0000)
core/src/ffluci/cbi.lua

index 5b38d1b..f653e45 100644 (file)
@@ -147,6 +147,7 @@ function Map.add(self, sectiontype)
        if name then
                self.ucidata[name] = {}
                self.ucidata[name][".type"] = sectiontype
+               self.ucidata[".order"] = self.ucidata[".order"] or {}
                table.insert(self.ucidata[".order"], name)
        end
        return name
@@ -164,6 +165,7 @@ function Map.set(self, section, option, value)
                                self.ucidata[section] = {}
                        end
                        self.ucidata[section][".type"] = val
+                       self.ucidata[".order"] = self.ucidata[".order"] or {}
                        table.insert(self.ucidata[".order"], section)
                end
        end