From adc8078de9cd5cd2baa718f882e40489865555c1 Mon Sep 17 00:00:00 2001 From: Oliver Kieselbach Date: Mon, 8 Jun 2026 18:21:02 +0200 Subject: [PATCH] fix(agent): silence CS8600 nullable warnings in Office host wiring #nullable enable: declare officeHost as nullable and make the no-Office onOfficeDoSample fallback a nullable cast. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../Orchestration/DefaultComponentFactory.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Agent/AutopilotMonitor.Agent.V2.Core/Orchestration/DefaultComponentFactory.cs b/src/Agent/AutopilotMonitor.Agent.V2.Core/Orchestration/DefaultComponentFactory.cs index 5a64b065..b79cc500 100644 --- a/src/Agent/AutopilotMonitor.Agent.V2.Core/Orchestration/DefaultComponentFactory.cs +++ b/src/Agent/AutopilotMonitor.Agent.V2.Core/Orchestration/DefaultComponentFactory.cs @@ -353,7 +353,7 @@ namespace AutopilotMonitor.Agent.V2.Core.Orchestration // RegNotifyChangeKeyValue, stop via Process.Exited. No idle polling. Constructed first so // the DO host can share its process-start signal and feed Office DO stats back to it. // Kill-switchable via remote config. - OfficeInstallDetectorHost officeHost = null; + OfficeInstallDetectorHost? officeHost = null; if (collectors.EnableOfficeInstallDetector) { officeHost = new OfficeInstallDetectorHost( @@ -380,7 +380,7 @@ namespace AutopilotMonitor.Agent.V2.Core.Orchestration intervalSeconds: collectors.DeliveryOptimizationIntervalSeconds, imeHost: _imeLogHost, officeProcessWatcher: officeHost?.ProcessWatcher, - onOfficeDoSample: officeHost != null ? officeHost.SubmitDoSample : (Action)null); + onOfficeDoSample: officeHost != null ? officeHost.SubmitDoSample : (Action?)null); hosts.Add(doHost); }