From c6c8f5cdf6adccc36780819ca5f5b400779f2e91 Mon Sep 17 00:00:00 2001 From: glax Date: Thu, 15 Jun 2023 18:50:50 +0200 Subject: [PATCH] TrangaSettings nullable library and notificationManagers will initialize a new Hashset --- Tranga/TrangaSettings.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tranga/TrangaSettings.cs b/Tranga/TrangaSettings.cs index 4295d2d..02de48d 100644 --- a/Tranga/TrangaSettings.cs +++ b/Tranga/TrangaSettings.cs @@ -16,15 +16,15 @@ public class TrangaSettings public HashSet libraryManagers { get; } public HashSet notificationManagers { get; } - public TrangaSettings(string downloadLocation, string workingDirectory, HashSet libraryManagers, - HashSet notificationManagers) + public TrangaSettings(string downloadLocation, string workingDirectory, HashSet? libraryManagers, + HashSet? notificationManagers) { if (downloadLocation.Length < 1 || workingDirectory.Length < 1) throw new ArgumentException("Download-location and working-directory paths can not be empty!"); this.workingDirectory = workingDirectory; this.downloadLocation = downloadLocation; - this.libraryManagers = libraryManagers; - this.notificationManagers = notificationManagers; + this.libraryManagers = libraryManagers??new(); + this.notificationManagers = notificationManagers??new(); } public static TrangaSettings LoadSettings(string importFilePath, Logger? logger)