applications/luci-vnstat: fix crash if dbdir is defined but not existing yet
This commit is contained in:
parent
254c8d368e
commit
8879c55bb3
1 changed files with 6 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue