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

remotes/tags/0.10.0
Jo-Philipp Wich 2011-04-28 10:27:00 +00:00
parent 254c8d368e
commit 8879c55bb3
1 changed files with 6 additions and 4 deletions

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