Fix edge deletion check to handle empty episodes list (#370)

This commit is contained in:
Pavlo Paliychuk 2025-04-17 16:36:40 -04:00 committed by GitHub
parent 9ca7ff6cf9
commit daaa0beab9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -797,7 +797,7 @@ class Graphiti:
# We should only delete edges created by the episode
edges_to_delete: list[EntityEdge] = []
for edge in edges:
if edge.episodes[0] == episode.uuid:
if edge.episodes and edge.episodes[0] == episode.uuid:
edges_to_delete.append(edge)
# Find nodes mentioned by the episode