From: Felix Fietkau Date: Tue, 3 Jun 2008 22:50:21 +0000 (+0000) Subject: some error handling for fs.dir(...) == nil X-Git-Tag: 0.8.0~891 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=7557c5bcef137e7e27c4dd56325a633231d91cc8 some error handling for fs.dir(...) == nil --- diff --git a/applications/luci-statistics/luasrc/statistics/datatree.lua b/applications/luci-statistics/luasrc/statistics/datatree.lua index ba6d7740b..327b8ef36 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