From 320e6adb84b4aa9c8d2a941eb33b7c87be257a80 Mon Sep 17 00:00:00 2001 From: hulkhan22 Date: Sat, 17 May 2025 13:04:34 +0200 Subject: [PATCH] Minor cleanup --- .../SPTarkov.Server.Core/Services/Mod/ProfileDataService.cs | 5 +---- SPTarkov.Server/Logger/SptLoggerExtensions.cs | 4 ++-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Libraries/SPTarkov.Server.Core/Services/Mod/ProfileDataService.cs b/Libraries/SPTarkov.Server.Core/Services/Mod/ProfileDataService.cs index 2b8e21b1..08fdaab5 100644 --- a/Libraries/SPTarkov.Server.Core/Services/Mod/ProfileDataService.cs +++ b/Libraries/SPTarkov.Server.Core/Services/Mod/ProfileDataService.cs @@ -42,10 +42,7 @@ public class ProfileDataService(ISptLogger logger, FileUtil public void SaveProfileData(string profileId, string modKey, T profileData) { - if (profileData == null) - { - throw new ArgumentNullException(nameof(profileData)); - } + ArgumentNullException.ThrowIfNull(profileData); var data = jsonUtil.Serialize(profileData, profileData.GetType()); if (data == null) diff --git a/SPTarkov.Server/Logger/SptLoggerExtensions.cs b/SPTarkov.Server/Logger/SptLoggerExtensions.cs index 92e7dba3..2f0f629c 100644 --- a/SPTarkov.Server/Logger/SptLoggerExtensions.cs +++ b/SPTarkov.Server/Logger/SptLoggerExtensions.cs @@ -8,7 +8,7 @@ public static class SptLoggerExtensions public static IHostBuilder UseSptLogger(this IHostBuilder builder) { - if (builder == null) throw new ArgumentNullException(nameof(builder)); + ArgumentNullException.ThrowIfNull(builder); builder.ConfigureServices((_, collection) => { @@ -20,7 +20,7 @@ public static class SptLoggerExtensions public static IServiceCollection AddSptLogger(this IServiceCollection collection) { - if (collection == null) throw new ArgumentNullException(nameof(collection)); + ArgumentNullException.ThrowIfNull(collection); collection.AddSingleton(sp => new SptLoggerProvider(sp.GetService(), sp.GetService(), sp.GetService()));