fix: Validate existence of entry path after improvements previews (#205)

This commit is contained in:
Hayden
2025-09-05 16:51:54 +08:00
committed by GitHub
parent 4f9a437725
commit 0295dd6288

View File

@@ -157,6 +157,8 @@ class ModelManager:
def get_all_files_entry(directory: str):
entries: list[os.DirEntry[str]] = []
if not os.path.exists(directory):
return []
with os.scandir(directory) as it:
for entry in it:
if not include_hidden_files and entry.name.startswith("."):