diff options
Diffstat (limited to 'core/ext/pm')
-rw-r--r-- | core/ext/pm/file_browser.lua | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/core/ext/pm/file_browser.lua b/core/ext/pm/file_browser.lua index ad70f75b..8aa6cf96 100644 --- a/core/ext/pm/file_browser.lua +++ b/core/ext/pm/file_browser.lua @@ -24,12 +24,15 @@ end function get_contents_for(full_path) local dir = {} local dirpath = table.concat(full_path, '/') - for name in lfs.dir(dirpath) do - if not name:find('^%.') then - dir[name] = { text = name } - if lfs.attributes(dirpath..'/'..name, 'mode') == 'directory' then - dir[name].parent = true - dir[name].pixbuf = 'gtk-directory' + local path = lfs.attributes(dirpath) + if path and path.mode == 'directory' then + for name in lfs.dir(dirpath) do + if not name:find('^%.') then + dir[name] = { text = name } + if lfs.attributes(dirpath..'/'..name, 'mode') == 'directory' then + dir[name].parent = true + dir[name].pixbuf = 'gtk-directory' + end end end end |