Skip to content

Commit

Permalink
Null exception with gitextensions#5473
Browse files Browse the repository at this point in the history
  • Loading branch information
spdr870 committed Sep 23, 2018
1 parent a41099c commit f8de0fa
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions GitUI/UserControls/RevisionGrid/Graph/GraphModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,12 @@ private bool MoveNext()
for (int curLane = 0; curLane < _laneNodes.Count; curLane++)
{
LaneJunctionDetail lane = _laneNodes[curLane];
if (lane == null)
{
// Abort, something went. Try again next time.
return false;
}

if (lane.Count == 0)
{
continue;
Expand Down Expand Up @@ -433,6 +439,12 @@ private bool MoveNext()
for (int curLane = 0; curLane < _laneNodes.Count; curLane++)
{
LaneJunctionDetail lane = _laneNodes[curLane];
if (lane == null)
{
// Abort, something went. Try again next time.
return false;
}

if (lane.Count == 0)
{
continue;
Expand Down Expand Up @@ -599,7 +611,7 @@ private int AdvanceLane(int curLane)
{
for (int i = 0; i < _laneNodes.Count; i++)
{
if (_laneNodes[i].Current == addedLane.Current)
if (_laneNodes[i] != null && _laneNodes[i].Current == addedLane.Current)
{
// We still advance the lane so it gets
// marked as processed.
Expand Down Expand Up @@ -644,7 +656,7 @@ private int AdvanceLane(int curLane)
// If any other lanes have this node on top, merge them together
for (int i = 0; i < _laneNodes.Count; i++)
{
if (i == curLane || curLane >= _laneNodes.Count)
if (i == curLane || curLane >= _laneNodes.Count || _laneNodes[i] == null)
{
continue;
}
Expand Down

0 comments on commit f8de0fa

Please sign in to comment.