Pass label to coalesce

When I want to pass a label to a coalesce step I get follwoing error:

"addE(occupied) failed because the from() traversal (which should give a Vertex) failed with: The provided traverser does not map to a value: v[10190][TinkerVertex]->[SelectOneStep(last,u,null)


this is my code:
g.addV('user').property('name', 'mari').as('u').
    out().has('location','name', "Z").fold().
    coalesce(
        __.unfold(),
        __.addV('location').property('name', "Z").as("loc").
        addE('occupied').from('u').to('loc')
    )


Appreciate your help
Was this page helpful?