fix: Validate existence of entry path after improvements previews (#205)
This commit is contained in:
@@ -157,6 +157,8 @@ class ModelManager:
|
|||||||
|
|
||||||
def get_all_files_entry(directory: str):
|
def get_all_files_entry(directory: str):
|
||||||
entries: list[os.DirEntry[str]] = []
|
entries: list[os.DirEntry[str]] = []
|
||||||
|
if not os.path.exists(directory):
|
||||||
|
return []
|
||||||
with os.scandir(directory) as it:
|
with os.scandir(directory) as it:
|
||||||
for entry in it:
|
for entry in it:
|
||||||
if not include_hidden_files and entry.name.startswith("."):
|
if not include_hidden_files and entry.name.startswith("."):
|
||||||
|
|||||||
Reference in New Issue
Block a user