Skip to content

Commit a9ddc46

Browse files
committed
GH-2470 - Respect empty path with just one node.
Closes #2470
1 parent 3871020 commit a9ddc46

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/org/springframework/data/neo4j/core/PreparedQuery.java

+8
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,14 @@ private Collection<?> aggregatePath(TypeSystem t, Value value,
186186
: value.asList(Value::asPath);
187187

188188
for (Path path : paths) {
189+
if (path.length() == 0) {
190+
// should only be exactly one
191+
Iterable<Node> pathNodes = path.nodes();
192+
for (Node pathNode : pathNodes) {
193+
nodes.add(Values.value(pathNode));
194+
}
195+
continue;
196+
}
189197
Node lastNode = null;
190198
for (Path.Segment segment : path) {
191199
Node start = segment.start();

0 commit comments

Comments
 (0)