diff options
author | Felix Fietkau <nbd@openwrt.org> | 2008-06-03 22:50:21 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2008-06-03 22:50:21 +0000 |
commit | 7557c5bcef137e7e27c4dd56325a633231d91cc8 (patch) | |
tree | dc49c7246cc1c1863a339d0fe6fd64dfdca77e15 /applications/luci-statistics | |
parent | 77f8074a01277917ab9ab0d00778f59bb0a88817 (diff) |
some error handling for fs.dir(...) == nil
Diffstat (limited to 'applications/luci-statistics')
-rw-r--r-- | applications/luci-statistics/luasrc/statistics/datatree.lua | 6 |
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 |