#vulnerable code 
                                @Test
    public void testVertexTransactionalCache2() {
        Vertex v1 = this.sqlgGraph.addVertex(T.label, "Person");
        Vertex v2 = this.sqlgGraph.addVertex(T.label, "Person");
        Vertex v3 = this.sqlgGraph.addVertex(T.label, "Person");
        Edge e1 = v1.addEdge("friend", v2);
        Assert.assertEquals(1, vertexTraversal(v1).out("friend").count().next().intValue());

        Vertex tmpV1 = edgeTraversal(this.sqlgGraph.e(e1.id())).outV().next();
        tmpV1.addEdge("foe", v3);
        //this should fail as v1's out edges will not be updated
        Assert.assertEquals(1, vertexTraversal(tmpV1).out("foe").count().next().intValue());
        Assert.assertEquals(1, vertexTraversal(v1).out("foe").count().next().intValue());
        this.sqlgGraph.tx().rollback();
    } 
                            #location 9 
                            #vulnerability type NULL_DEREFERENCE
#fixed code
                                @Test
    public void testVertexTransactionalCache2() {
        Vertex v1 = this.sqlgGraph.addVertex(T.label, "Person");
        Vertex v2 = this.sqlgGraph.addVertex(T.label, "Person");
        Vertex v3 = this.sqlgGraph.addVertex(T.label, "Person");
        Edge e1 = v1.addEdge("friend", v2);
        Assert.assertEquals(1, vertexTraversal(v1).out("friend").count().next().intValue());

        Vertex tmpV1 = edgeTraversal(this.sqlgGraph.traversal().E(e1.id()).next()).outV().next();
        tmpV1.addEdge("foe", v3);
        //this should fail as v1's out edges will not be updated
        Assert.assertEquals(1, vertexTraversal(tmpV1).out("foe").count().next().intValue());
        Assert.assertEquals(1, vertexTraversal(v1).out("foe").count().next().intValue());
        this.sqlgGraph.tx().rollback();
    }