file_manager: skip broken symlinks in list directory

This resolves an issue where an exception is raised when path info is requested.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Arksine 2021-01-05 11:27:46 -05:00
parent 67adcfc448
commit 6fcb26ddd7
1 changed files with 2 additions and 0 deletions

View File

@ -280,6 +280,8 @@ class FileManager:
flist = {'dirs': [], 'files': []} flist = {'dirs': [], 'files': []}
for fname in os.listdir(path): for fname in os.listdir(path):
full_path = os.path.join(path, fname) full_path = os.path.join(path, fname)
if not os.path.exists(full_path):
continue
path_info = self._get_path_info(full_path) path_info = self._get_path_info(full_path)
if os.path.isdir(full_path): if os.path.isdir(full_path):
path_info['dirname'] = fname path_info['dirname'] = fname