From 6f38bbfa1aeca147cc3606b16556c4ff4dee3be5 Mon Sep 17 00:00:00 2001 From: Erik Darling <2136037+erikdarlingdata@users.noreply.github.com> Date: Sat, 9 May 2026 10:58:12 -0500 Subject: [PATCH] Add nullability guards to remaining comparison overlay tasks The Blocking, Memory, and IO branches in the comparison overlay section of CorrelatedTimelineLanesControl were missing the `&& Result != null` guard the CPU and Wait branches already had. Apply uniformly so a null result from `_dataService.Get*TrendAsync` can't NRE on the subsequent .Select / .GroupBy. Co-Authored-By: Claude Opus 4.7 (1M context) --- Lite/Controls/CorrelatedTimelineLanesControl.xaml.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lite/Controls/CorrelatedTimelineLanesControl.xaml.cs b/Lite/Controls/CorrelatedTimelineLanesControl.xaml.cs index af872f0..10bd423 100644 --- a/Lite/Controls/CorrelatedTimelineLanesControl.xaml.cs +++ b/Lite/Controls/CorrelatedTimelineLanesControl.xaml.cs @@ -182,7 +182,7 @@ await Task.WhenAll(cpuTask, waitTask, blockingTask, deadlockTask, memoryTask, fi AddGhostLine(WaitStatsChart, refWaitTask.Result .Select(d => (d.CollectionTime.AddMinutes(utcOffset).Add(timeShift).ToOADate(), d.WaitTimeMsPerSecond)).ToList(), "#FFB74D"); - if (refBlockingTask.IsCompletedSuccessfully) + if (refBlockingTask.IsCompletedSuccessfully && refBlockingTask.Result != null) { var refBlocking = refBlockingTask.Result .Select(d => (d.Time.AddMinutes(utcOffset).Add(timeShift).ToOADate(), (double)d.Count)).ToList(); @@ -190,11 +190,11 @@ await Task.WhenAll(cpuTask, waitTask, blockingTask, deadlockTask, memoryTask, fi AddGhostLine(BlockingChart, refBlocking, "#E57373"); } - if (refMemoryTask.IsCompletedSuccessfully) + if (refMemoryTask.IsCompletedSuccessfully && refMemoryTask.Result != null) AddGhostLine(MemoryChart, refMemoryTask.Result .Select(d => (d.CollectionTime.AddMinutes(utcOffset).Add(timeShift).ToOADate(), d.BufferPoolMb)).ToList(), "#CE93D8"); - if (refIoTask.IsCompletedSuccessfully) + if (refIoTask.IsCompletedSuccessfully && refIoTask.Result != null) { var refIo = refIoTask.Result .GroupBy(d => d.CollectionTime)