summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-statistics
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2008-06-03 22:50:21 +0000
committerFelix Fietkau <nbd@openwrt.org>2008-06-03 22:50:21 +0000
commit7557c5bcef137e7e27c4dd56325a633231d91cc8 (patch)
treedc49c7246cc1c1863a339d0fe6fd64dfdca77e15 /applications/luci-statistics
parent77f8074a01277917ab9ab0d00778f59bb0a88817 (diff)
some error handling for fs.dir(...) == nil
Diffstat (limited to 'applications/luci-statistics')
-rw-r--r--applications/luci-statistics/luasrc/statistics/datatree.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/applications/luci-statistics/luasrc/statistics/datatree.lua b/applications/luci-statistics/luasrc/statistics/datatree.lua
index ba6d7740b1..327b8ef36a 100644
--- a/applications/luci-statistics/luasrc/statistics/datatree.lua
+++ b/applications/luci-statistics/luasrc/statistics/datatree.lua
@@ -44,7 +44,11 @@ function Instance._notzero( self, table )
end
function Instance._scan( self )
- for i, plugin in ipairs( fs.dir( self._libdir ) ) do
+ local dir = fs.dir( self._libdir )
+ if not dir then
+ return
+ end
+ for i, plugin in ipairs( dir ) do
if plugin:match("%w+.so") then
self._plugins[ plugin:gsub(".so", "") ] = { }
end