mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-03-24 02:23:30 +08:00
Guard against None base_dir in _collect_output_absolute_paths
Return early with an empty list when folder_paths.get_directory_by_type('output')
returns None to avoid os.path.join(None, ...) producing invalid paths.
Amp-Thread-ID: https://ampcode.com/threads/T-019cfbe5-dffc-760a-9a37-9b041dd71e73
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
parent
01d82af10f
commit
e76689b80c
2
main.py
2
main.py
@ -245,6 +245,8 @@ def _collect_output_absolute_paths(history_result: dict) -> list[str]:
|
|||||||
"""Extract absolute file paths for output items from a history result."""
|
"""Extract absolute file paths for output items from a history result."""
|
||||||
paths = []
|
paths = []
|
||||||
base_dir = folder_paths.get_directory_by_type("output")
|
base_dir = folder_paths.get_directory_by_type("output")
|
||||||
|
if base_dir is None:
|
||||||
|
return paths
|
||||||
for node_output in history_result.get("outputs", {}).values():
|
for node_output in history_result.get("outputs", {}).values():
|
||||||
for items in node_output.values():
|
for items in node_output.values():
|
||||||
if not isinstance(items, list):
|
if not isinstance(items, list):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user