* luci/themes: do an explicit check for table data type on result of uci.changes()
[oweals/luci.git] / themes / openwrt.org / luasrc / view / themes / openwrt.org / header.htm
index 71328e414150a349c9c0d85e78973ff90fb69fdc..f18d0bce3944fae5649ccf22f3f98c0721ba7133 100644 (file)
@@ -121,9 +121,12 @@ end
                        if "admin" == request[1] then
                                require("luci.model.uci") 
                                local ucic = 0
-                               for n, s in pairs(luci.model.uci.changes()) do
-                                       for no, o in pairs(s) do
-                                               ucic = ucic + 1;
+                                local changes = luci.model.uci.changes()
+                               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;
+                                               end
                                        end
                                end
                %>