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 iface
for iface in fs.dir(dbdir) do
if iface:sub(1,1) ~= '.' then
ifaces[iface] = iface
enabled[iface] = iface
if fs.access(dbdir) then
for iface in fs.dir(dbdir) do
if iface:sub(1,1) ~= '.' then
ifaces[iface] = iface
enabled[iface] = iface
end
end
end