From 808ccc66433bb4842a7f314ca776bdc731e7d188 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Thu, 23 Nov 2023 20:07:46 -0500 Subject: [PATCH] Nullify `GitHubClientFactory` --- .../Utils/GitHub/GitHubClientFactory.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs b/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs index 40f76ecb57..e479388b79 100644 --- a/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs +++ b/src/Tgstation.Server.Host/Utils/GitHub/GitHubClientFactory.cs @@ -9,8 +9,6 @@ using Octokit; using Tgstation.Server.Host.Configuration; using Tgstation.Server.Host.System; -#nullable disable - namespace Tgstation.Server.Host.Utils.GitHub { /// @@ -78,7 +76,7 @@ namespace Tgstation.Server.Host.Utils.GitHub /// /// Optional access token to use as credentials. /// The for the given . - GitHubClient GetOrCreateClient(string accessToken) + GitHubClient GetOrCreateClient(string? accessToken) { GitHubClient client; bool cacheHit; @@ -99,10 +97,11 @@ namespace Tgstation.Server.Host.Utils.GitHub var now = DateTimeOffset.UtcNow; if (!cacheHit) { + var product = assemblyInformationProvider.ProductInfoHeaderValue.Product!; client = new GitHubClient( new ProductHeaderValue( - assemblyInformationProvider.ProductInfoHeaderValue.Product.Name, - assemblyInformationProvider.ProductInfoHeaderValue.Product.Version)); + product.Name, + product.Version)); if (accessToken != null) client.Credentials = new Credentials(accessToken);