From da0da4e6ebfbd8202ae05a380c877fb22e527470 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Thu, 23 Nov 2023 20:58:16 -0500 Subject: [PATCH] Nullify `JobProgressReporter` --- .../Jobs/JobProgressReporter.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Tgstation.Server.Host/Jobs/JobProgressReporter.cs b/src/Tgstation.Server.Host/Jobs/JobProgressReporter.cs index 37b7ae03e2..753f8cf519 100644 --- a/src/Tgstation.Server.Host/Jobs/JobProgressReporter.cs +++ b/src/Tgstation.Server.Host/Jobs/JobProgressReporter.cs @@ -4,8 +4,6 @@ using Microsoft.Extensions.Logging; using Tgstation.Server.Host.Models; -#nullable disable - namespace Tgstation.Server.Host.Jobs { /// @@ -16,7 +14,7 @@ namespace Tgstation.Server.Host.Jobs /// /// The name of the current stage. /// - public string StageName + public string? StageName { get => stageName; set @@ -37,12 +35,12 @@ namespace Tgstation.Server.Host.Jobs /// /// Progress reporter callback taking a description of what the job is currently doing and the (optional) progress of the job on a scale from 0.0-1.0. /// - readonly Action callback; + readonly Action callback; /// /// Backing field for . /// - string stageName; + string? stageName; /// /// The last progress value pushed into the . @@ -60,7 +58,7 @@ namespace Tgstation.Server.Host.Jobs /// The value of . /// The value of . /// The value of . - public JobProgressReporter(ILogger logger, string stageName, Action callback) + public JobProgressReporter(ILogger logger, string? stageName, Action callback) { this.logger = logger ?? throw new ArgumentNullException(nameof(logger)); this.callback = callback ?? throw new ArgumentNullException(nameof(callback)); @@ -99,7 +97,7 @@ namespace Tgstation.Server.Host.Jobs /// The 0.0f-1.0f percentage of the current 's percentage should be given to the section. /// A new that is a subsection of this one. /// A should only have one active child at a time. - public JobProgressReporter CreateSection(string newStageName, double percentage) + public JobProgressReporter CreateSection(string? newStageName, double percentage) { if (percentage > 1 || percentage < 0) {