applications/luci-vnstat: fix crash if dbdir is defined but not existing yet

This commit is contained in:
Jo-Philipp Wich 2011-04-28 10:27:00 +00:00
parent 254c8d368e
commit 8879c55bb3

View file

@ -37,10 +37,12 @@ local ifaces = { }
local enabled = { } local enabled = { }
local iface local iface
for iface in fs.dir(dbdir) do if fs.access(dbdir) then
if iface:sub(1,1) ~= '.' then for iface in fs.dir(dbdir) do
ifaces[iface] = iface if iface:sub(1,1) ~= '.' then
enabled[iface] = iface ifaces[iface] = iface
enabled[iface] = iface
end
end end
end end