diff --git a/src/main/java/com/tinkerpop/frames/annotations/AdjacencyAnnotationHandler.java b/src/main/java/com/tinkerpop/frames/annotations/AdjacencyAnnotationHandler.java index 639cf07..bfcff9d 100644 --- a/src/main/java/com/tinkerpop/frames/annotations/AdjacencyAnnotationHandler.java +++ b/src/main/java/com/tinkerpop/frames/annotations/AdjacencyAnnotationHandler.java @@ -48,6 +48,8 @@ public Object processVertex(final Adjacency adjacency, final Method method, fina returnValue = framedGraph.addVertex(null, returnType); newVertex = ((VertexFrame) returnValue).asVertex(); } else { + if (arguments[0] == null) + throw new IllegalArgumentException("null passed to @Adjacency " + method.getName() + " labelled " + adjacency.label()); newVertex = ((VertexFrame) arguments[0]).asVertex(); } addEdges(adjacency, framedGraph, vertex, newVertex); @@ -101,4 +103,4 @@ private void removeEdges(final Direction direction, final String label, final Ve } } } -} \ No newline at end of file +}