mirror of
https://github.com/openwrt/luci.git
synced 2026-08-29 08:31:46 +04:00
applications/luci-splash: fix another crash in luci-splash when there were empty whitelist/blacklist sections
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user