Minor cleanup

This commit is contained in:
hulkhan22
2025-05-17 13:04:34 +02:00
parent 20df3dafbd
commit 320e6adb84
2 changed files with 3 additions and 6 deletions
@@ -42,10 +42,7 @@ public class ProfileDataService(ISptLogger<ProfileDataService> logger, FileUtil
public void SaveProfileData<T>(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)
@@ -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<ILoggerFactory>(sp =>
new SptLoggerProvider(sp.GetService<JsonUtil>(), sp.GetService<FileUtil>(), sp.GetService<SptLoggerQueueManager>()));