some error handling for fs.dir(...) == nil

This commit is contained in:
Felix Fietkau 2008-06-03 22:50:21 +00:00
parent 77f8074a01
commit 7557c5bcef

View file

@ -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