microsoft / ApplicationInsights-dotnet-server

Microsoft Application Insights for .NET Web Applications
https://azure.microsoft.com/services/application-insights/
133 stars 67 forks source link

Check for null serviceClient when disposing QuickPulseTelemetryModule. #1169

Closed brettsam closed 5 years ago

brettsam commented 5 years ago

To get around #1168, we had plans to delay the call to QuickPulseTelemetryModule.Initialize() by 15 seconds. But we found that if the site was being shut down before those 15 seconds had expired, we'd get a NullRef. I'm guessing it's b/c of the missing null-check on serviceClient here: https://github.com/Microsoft/ApplicationInsights-dotnet-server/blob/develop/Src/PerformanceCollector/Perf.Shared/QuickPulseTelemetryModule.cs#L700.

/cc @lmolkova