some error handling for fs.dir(...) == nil
This commit is contained in:
parent
77f8074a01
commit
7557c5bcef
1 changed files with 5 additions and 1 deletions
|
@ -44,7 +44,11 @@ function Instance._notzero( self, table )
|
||||||
end
|
end
|
||||||
|
|
||||||
function Instance._scan( self )
|
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
|
if plugin:match("%w+.so") then
|
||||||
self._plugins[ plugin:gsub(".so", "") ] = { }
|
self._plugins[ plugin:gsub(".so", "") ] = { }
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue