* 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 5b38d1b50a6e742247b3a671aca28cf0b24d2f25..f653e457d2026ffccb3a8d4179f52af848bd3942 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