From 887f6ed81a2cb6036163105433b160e1343daf98 Mon Sep 17 00:00:00 2001 From: yangdx Date: Sat, 8 Mar 2025 11:20:22 +0800 Subject: [PATCH] Fix return empty list when no edges is found --- lightrag/kg/neo4j_impl.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightrag/kg/neo4j_impl.py b/lightrag/kg/neo4j_impl.py index cf3c024f..34226df7 100644 --- a/lightrag/kg/neo4j_impl.py +++ b/lightrag/kg/neo4j_impl.py @@ -520,7 +520,7 @@ class Neo4JStorage(BaseGraphStorage): edges.append((source_label, target_label)) await results.consume() # Ensure results are consumed - return edges if edges else None + return edges except Exception as e: logger.error(f"Error getting edges for node {node_label}: {str(e)}") await results.consume() # Ensure results are consumed even on error