git.99rst.org
/
openwrt-luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
| inline |
side by side
(parent:
254c8d3
)
applications/luci-vnstat: fix crash if dbdir is defined but not existing yet
author
Jo-Philipp Wich
<redacted>
Thu, 28 Apr 2011 10:27:00 +0000
(10:27 +0000)
committer
Jo-Philipp Wich
<redacted>
Thu, 28 Apr 2011 10:27:00 +0000
(10:27 +0000)
applications/luci-vnstat/luasrc/model/cbi/vnstat.lua
patch
|
blob
|
history
diff --git
a/applications/luci-vnstat/luasrc/model/cbi/vnstat.lua
b/applications/luci-vnstat/luasrc/model/cbi/vnstat.lua
index 9161ec6a67364ea6e04ccdab6d8f505b4392584d..5c5e8f7aa21cac1ea085f05d6da139211d81e0a9 100644
(file)
--- a/
applications/luci-vnstat/luasrc/model/cbi/vnstat.lua
+++ b/
applications/luci-vnstat/luasrc/model/cbi/vnstat.lua
@@
-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
git clone https://git.99rst.org/PROJECT