NullPointerException is thrown while calling org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext

Open
#9,841 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
28/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
databases

Research direction

Start at org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversal.hasNext and trace the traversal created by getGTS().V(myObject.getVertex()).out(tag). Reproduce the case where the vertex has no connected vertices, then identify why hasNext throws a NullPointerException instead of returning a boolean. Done means the reported traversal behaves as expected for that case.

Written by the indexing model from the issue text.

Description

OrientDB Version: 3.0.30
Java Version: 1.8.0_202
OS: MacOS Monterey (V 12.4)

Code : GraphTraversal<Vertex, Vertex> ft = getGTS().V(myObject.getVertex()).out(tag);
return ft!=null && ft.hasNext();

Expected behavior

ft.hasNext() to be returned true or false

Actual behavior

throwing NullPointer exception
Screenshot 2022-07-09 at 1 05 37 PM

Steps to reproduce

  1. Create a Vertex
  2. Point the traversal to the vertex
  3. Look for the connected Vertexes when none are present.
Dominant language
Java
Stars
5k
Forks
868
Avg merge
15h 6m
Merged PRs (30d)
18

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from orientechnologies/orientdb

All issues in orientechnologies/orientdb

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.