avoid potential null ptr deref (Coverity)
This commit is contained in:
parent
9420672520
commit
1febc36e15
|
@ -97,7 +97,9 @@ public class Graph<T> {
|
||||||
n = tNode;
|
n = tNode;
|
||||||
if ( !visited.contains(n) ) break;
|
if ( !visited.contains(n) ) break;
|
||||||
}
|
}
|
||||||
DFS(n, visited, sorted);
|
if (n!=null) { // if at least one unvisited
|
||||||
|
DFS(n, visited, sorted);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return sorted;
|
return sorted;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue