Skip to content

Commit

Permalink
Fixed NPE
Browse files Browse the repository at this point in the history
Issue #6807
  • Loading branch information
lvca committed Oct 18, 2016
1 parent c885e78 commit 9d2b1a6
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2075,6 +2075,10 @@ protected static void removeEdges(final OrientBaseGraph graph, final ODocument i
for (Iterator<OIdentifiable> it = bag.rawIterator(); it.hasNext();) {
final ODocument curr = getDocument(it.next(), forceReload);

if(curr == null)
// EDGE REMOVED
continue;

if (curr == null)
// ALREADY DELETED (BYPASSING GRAPH API?), JUST REMOVE THE REFERENCE FROM BAG
it.remove();
Expand Down Expand Up @@ -2127,6 +2131,10 @@ else if (iVertexToRemove.equals(curr)) {
for (Iterator<OIdentifiable> it = col.iterator(); it.hasNext();) {
final ODocument curr = getDocument(it.next(), forceReload);

if(curr == null)
// EDGE REMOVED
continue;

if (iVertexToRemove.equals(curr)) {
// FOUND AS VERTEX
it.remove();
Expand Down Expand Up @@ -2220,6 +2228,9 @@ private static void removeInverseEdge(final OrientBaseGraph graph, final ODocume
}

private static ODocument getDocument(final OIdentifiable id, final boolean forceReload) {
if(id == null )
return null;

final ODocument doc = id.getRecord();

if (doc != null && forceReload) {
Expand Down

0 comments on commit 9d2b1a6

Please sign in to comment.