From: Manuel Munz Date: Mon, 11 Nov 2013 20:12:40 +0000 (+0000) Subject: applications/luci-splash: fix another crash in luci-splash when there were empty... X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e97596f42d5376a10c6a2aebfe8752c687c9e290;p=project%2Fluci.git applications/luci-splash: fix another crash in luci-splash when there were empty whitelist/blacklist sections --- diff --git a/applications/luci-splash/root/usr/sbin/luci-splash b/applications/luci-splash/root/usr/sbin/luci-splash index 25a12f6a43..6b1e41edbd 100755 --- a/applications/luci-splash/root/usr/sbin/luci-splash +++ b/applications/luci-splash/root/usr/sbin/luci-splash @@ -291,21 +291,28 @@ function get_known_macs(list) local leased_macs = { } if not list or list == "lease" then - - uci:foreach("luci_splash_leases", "lease", - function(s) leased_macs[s.mac:lower()] = true end) + uci:foreach("luci_splash_leases", "lease", function(s) + if s.mac then + leased_macs[s.mac:lower()] = true + end + end) end if not list or list == "whitelist" then - uci:foreach("luci_splash", "whitelist", - function(s) leased_macs[s.mac:lower()] = true end) + uci:foreach("luci_splash", "whitelist", function(s) + if s.mac then + leased_macs[s.mac:lower()] = true + end + end) end if not list or list == "blacklist" then - uci:foreach("luci_splash", "blacklist", - function(s) leased_macs[s.mac:lower()] = true end) + uci:foreach("luci_splash", "blacklist", function(s) + if s.mac then + leased_macs[s.mac:lower()] = true + end + end) end - return leased_macs end