* luci/themes: do an explicit check for table data type on result of uci.changes()
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 4 Jun 2008 23:40:40 +0000 (23:40 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 4 Jun 2008 23:40:40 +0000 (23:40 +0000)
themes/fledermaus/luasrc/view/themes/fledermaus/header.htm
themes/openwrt.org/luasrc/view/themes/openwrt.org/header.htm

index a8ecff7..32d844f 100644 (file)
@@ -122,7 +122,7 @@ end
                                require("luci.model.uci") 
                                local ucic = 0
                                local changes = luci.model.uci.changes()
                                require("luci.model.uci") 
                                local ucic = 0
                                local changes = luci.model.uci.changes()
-                               if changes then
+                               if type(changes) == "table" then        -- XXX: sometimes string or nil / needs investigation
                                        for n, s in pairs(changes) do
                                                for no, o in pairs(s) do
                                                        ucic = ucic + 1;
                                        for n, s in pairs(changes) do
                                                for no, o in pairs(s) do
                                                        ucic = ucic + 1;
index ee784f2..f18d0bc 100644 (file)
@@ -122,7 +122,7 @@ end
                                require("luci.model.uci") 
                                local ucic = 0
                                 local changes = luci.model.uci.changes()
                                require("luci.model.uci") 
                                local ucic = 0
                                 local changes = luci.model.uci.changes()
-                               if changes then
+                               if type(changes) == "table" then        -- XXX: sometimes string or nil / needs investigation
                                        for n, s in pairs(changes) do
                                                for no, o in pairs(s) do
                                                        ucic = ucic + 1;
                                        for n, s in pairs(changes) do
                                                for no, o in pairs(s) do
                                                        ucic = ucic + 1;