mirror of https://github.com/openwrt/luci.git
applications/luci-vnstat: fix crash if dbdir is defined but not existing yet
parent
254c8d368e
commit
8879c55bb3
|
@ -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 New Issue