fix: guard mem._memory access in reset_memories for new None default

This commit is contained in:
Greyson LaLonde
2026-05-21 00:53:14 +08:00
parent 3ceb9a287a
commit 0991f7994a

View File

@@ -25,7 +25,7 @@ def _reset_flow_memory(flow: Flow[Any]) -> None:
try:
if hasattr(mem, "reset"):
mem.reset()
elif hasattr(mem, "_memory") and hasattr(mem._memory, "reset"):
elif hasattr(mem, "_memory") and mem._memory is not None:
mem._memory.reset()
except (FileNotFoundError, OSError):
pass