diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERAnalyzer.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERAnalyzer.cs index 7f62b1469f..2ecc366177 100644 --- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERAnalyzer.cs +++ b/tools/DevDiagnostics/DevHome.DevDiagnostics/Models/WERAnalyzer.cs @@ -79,17 +79,20 @@ private void AllExternalTools_CollectionChanged(object? sender, NotifyCollection // with it. if (e.Action == NotifyCollectionChangedAction.Add && e.NewItems is not null) { + List newAnalysisTools = new(); + foreach (Tool tool in e.NewItems) { if (tool.Type.HasFlag(ToolType.DumpAnalyzer)) { _registeredAnalysisTools.Add(tool); + newAnalysisTools.Add(tool); } } foreach (var report in _werAnalysisReports) { - RunToolAnalysis(report, e.NewItems.Cast().ToList()); + RunToolAnalysis(report, newAnalysisTools); } } @@ -101,11 +104,11 @@ private void AllExternalTools_CollectionChanged(object? sender, NotifyCollection if (tool.Type.HasFlag(ToolType.DumpAnalyzer)) { _registeredAnalysisTools.Remove(tool); - } - foreach (var report in _werAnalysisReports) - { - report.RemoveToolAnalysis(tool); + foreach (var report in _werAnalysisReports) + { + report.RemoveToolAnalysis(tool); + } } } } diff --git a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WERPage.xaml.cs b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WERPage.xaml.cs index da708366fd..d929fad677 100644 --- a/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WERPage.xaml.cs +++ b/tools/DevDiagnostics/DevHome.DevDiagnostics/Pages/WERPage.xaml.cs @@ -127,7 +127,7 @@ private void UpdateInfoBox() } else { - Debug.Assert(currentSelectedIndex == 0, "Expected only the first item would have a null tag"); + Debug.Assert(currentSelectedIndex == 0 || currentSelectedIndex == -1, "Expected only the first item would have a null tag"); WERInfo.Text = info.Report.Description; } }