[fix] Filesearcher crash on empty file attributes (#5351)

Fixes <https://github.com/koreader/koreader/issues/5343>.
pull/5357/head
Frans de Jonge 5 years ago committed by GitHub
parent ed4396821f
commit 6c93415f67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -37,7 +37,7 @@ function FileSearcher:readDir()
-- handle files in d
for f in lfs.dir(d) do
local fullpath = d.."/"..f
local attributes = lfs.attributes(fullpath)
local attributes = lfs.attributes(fullpath) or {}
if attributes.mode == "directory" and f ~= "." and f~=".." then
table.insert(new_dirs, fullpath)
table.insert(self.files, {name = f, path = fullpath, attr = attributes})

Loading…
Cancel
Save