Skip to content

Commit 82e83e1

Browse files
committed
fixed handling null in AQL deserializer
1 parent 7f98b22 commit 82e83e1

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/main/java/com/arangodb/tinkerpop/gremlin/utils/AqlDeserializer.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ public Object deserialize(JsonNode node) {
5050
}
5151

5252
private Object doDeserialize(JsonNode node) throws IOException {
53-
if (isEdge(node)) {
53+
if (node == null) {
54+
return null;
55+
} else if (isEdge(node)) {
5456
EdgeData data = mapper.readerFor(EdgeData.class).readValue(node);
5557
return new ArangoDBEdge(graph, data);
5658
} else if (isVertex(node)) {

src/test/java/com/arangodb/tinkerpop/gremlin/arangodb/simple/AqlTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ public void shouldReadSimpleValue() {
7575
assertThat(result).isEqualTo("hello");
7676
}
7777

78+
@Test
79+
public void shouldReadNullValue() {
80+
String result = graph().<String>aql(
81+
"RETURN null"
82+
).next();
83+
assertThat(result).isNull();
84+
}
85+
7886
@Test
7987
public void shouldReadVertex() {
8088
Vertex v = graph.addVertex();

0 commit comments

Comments
 (0)