From 840e1d2fc919661c443884f7d59a954151805a97 Mon Sep 17 00:00:00 2001 From: chenyijian Date: Thu, 22 Jan 2026 10:59:14 +0800 Subject: [PATCH] fix err when directories can not access --- folder_paths.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/folder_paths.py b/folder_paths.py index 9c96540e3..1b869c482 100644 --- a/folder_paths.py +++ b/folder_paths.py @@ -404,7 +404,11 @@ def cached_filename_list_(folder_name: str) -> tuple[list[str], dict[str, float] for x in out[1]: time_modified = out[1][x] folder = x - if os.path.getmtime(folder) != time_modified: + try: + if os.path.getmtime(folder) != time_modified: + return None + except Exception as e: + logging.warning(f"Warning: Unable to access {folder}. Error: {e}. Skipping this folder.") return None folders = folder_names_and_paths[folder_name]