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

Lesson 2.3 - completed code throws an unhandled NullReferenceException on exit #108

Closed
da9l opened this issue May 16, 2015 · 1 comment
Closed

Comments

@da9l
Copy link

da9l commented May 16, 2015

When running the completed code or the code I wrote following the guide I get an unhandled NullReferenceException in ChartingActor.cs in HandleMetrics (See comment below)

private void HandleMetrics(Metric metric)
    {
        if (!string.IsNullOrEmpty(metric.Series) && _seriesIndex.ContainsKey(metric.Series))
        {
            var series = _seriesIndex[metric.Series];
            series.Points.AddXY(xPosCounter++, metric.CounterValue); // <- series.Points is null!
            while(series.Points.Count > MaxPoints) series.Points.RemoveAt(0);
            SetChartBoundaries();
        }
    }

I've managed to reproduce the problem when enabling all performance counters, disabling them and enabling them again and then exit the application.

@skotzko
Copy link
Contributor

skotzko commented May 25, 2015

Thank you for submitting this. This shows up if you close the winforms app but don't stop debugging. However, not to fix as it doesn't materially impact the objective of these exercises (and this is just sample code anyway).

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

No branches or pull requests

2 participants