From: Jo-Philipp Wich Date: Wed, 4 Jun 2008 21:01:48 +0000 (+0000) Subject: * luci/themes: fix admin header template, crashes badly when luci.model.uci.changes... X-Git-Tag: 0.8.0~882 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=25e71a2acf91c084bf18049fc0d159fa19673876 * luci/themes: fix admin header template, crashes badly when luci.model.uci.changes() returns nil (shouldn't we move this code snipped into a helper function or sth. like that?) --- diff --git a/themes/fledermaus/luasrc/view/themes/fledermaus/header.htm b/themes/fledermaus/luasrc/view/themes/fledermaus/header.htm index 2aea59cfd..40086d9ca 100644 --- a/themes/fledermaus/luasrc/view/themes/fledermaus/header.htm +++ b/themes/fledermaus/luasrc/view/themes/fledermaus/header.htm @@ -121,7 +121,8 @@ end if "admin" == request[1] then require("luci.model.uci") local ucic = 0 - for n, s in pairs(luci.model.uci.changes()) do + local changes = luci.model.uci.changes() + for n, s in pairs(changes) do for no, o in pairs(s) do ucic = ucic + 1; end diff --git a/themes/openwrt.org/luasrc/view/themes/openwrt.org/header.htm b/themes/openwrt.org/luasrc/view/themes/openwrt.org/header.htm index 71328e414..3ecc8d73c 100644 --- a/themes/openwrt.org/luasrc/view/themes/openwrt.org/header.htm +++ b/themes/openwrt.org/luasrc/view/themes/openwrt.org/header.htm @@ -121,7 +121,8 @@ end if "admin" == request[1] then require("luci.model.uci") local ucic = 0 - for n, s in pairs(luci.model.uci.changes()) do + local changes = luci.model.uci.changes() + for n, s in pairs(changes) do for no, o in pairs(s) do ucic = ucic + 1; end