From 38728291fc44af97e2d835d2060988ad5f04718a Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Sat, 25 Nov 2023 16:47:02 -0500 Subject: [PATCH] Nullify `ConfigurationController` --- .../Controllers/ConfigurationController.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs b/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs index 2b95796ef7..1df1fbc907 100644 --- a/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs +++ b/src/Tgstation.Server.Host/Controllers/ConfigurationController.cs @@ -19,8 +19,6 @@ using Tgstation.Server.Host.Models; using Tgstation.Server.Host.Security; using Tgstation.Server.Host.Utils; -#nullable disable - namespace Tgstation.Server.Host.Controllers { /// @@ -75,7 +73,7 @@ namespace Tgstation.Server.Host.Controllers public async ValueTask Update([FromBody] ConfigurationFileRequest model, CancellationToken cancellationToken) { ArgumentNullException.ThrowIfNull(model); - if (ForbidDueToModeConflicts(model.Path, out var systemIdentity)) + if (ForbidDueToModeConflicts(model.Path!, out var systemIdentity)) return Forbid(); try @@ -166,7 +164,7 @@ namespace Tgstation.Server.Host.Controllers [ProducesResponseType(typeof(ErrorMessageResponse), 409)] [ProducesResponseType(typeof(ErrorMessageResponse), 410)] public ValueTask Directory( - string directoryPath, + string? directoryPath, [FromQuery] int? page, [FromQuery] int? pageSize, CancellationToken cancellationToken) @@ -340,7 +338,7 @@ namespace Tgstation.Server.Host.Controllers /// The path to validate if any. /// The to use when calling into . /// if a should be returned, otherwise. - bool ForbidDueToModeConflicts(string path, out ISystemIdentity systemIdentityToUse) + bool ForbidDueToModeConflicts(string? path, out ISystemIdentity? systemIdentityToUse) { if (Instance.ConfigurationType == ConfigurationType.Disallowed || (Instance.ConfigurationType == ConfigurationType.SystemIdentityWrite && AuthenticationContext.SystemIdentity == null)