Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed null reference when hovering over lane in graph #5724

Merged
merged 1 commit into from Nov 7, 2018

Conversation

spdr870
Copy link
Member

@spdr870 spdr870 commented Nov 7, 2018

Fixes null reference when hovering over a lane that continues beyond the limit of the graph. For example, see the screenprint below. The linux repo has over 600.000 commits. Its limited by default on 100.000 commits. Go to the last commit and hover over the lanes in the graph. A null reference is thrown. The application doesn't crash, the exception is eaten somewhere. Still, its better to prevent.

image

Changes proposed in this pull request:

  • Added null check

What did I do to test the code and ensure quality:

  • Manual testing

Has been tested on (remove any that don't apply):

  • GIT 2.19
  • Windows 10

@ghost ghost assigned spdr870 Nov 7, 2018
@ghost ghost added the status: ready label Nov 7, 2018
@@ -505,7 +505,7 @@ string GetLaneInfo(int x, int rowIndex)
if (segmentsForLane.Count() == 1)
{
// Crossing lange
laneInfoText.Append(segmentsForLane.First().Parent.GitRevision.Body ?? segmentsForLane.First().Parent.GitRevision.Subject);
laneInfoText.Append(segmentsForLane.First().Parent.GitRevision?.Body ?? segmentsForLane.First().Parent.GitRevision?.Subject);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can Parent be null?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, a segment only exists with both a parent and a child.

@spdr870 spdr870 merged commit e48361f into gitextensions:master Nov 7, 2018
@ghost ghost removed the status: ready label Nov 7, 2018
@spdr870 spdr870 added this to the 3.00 milestone Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants