From 11461051f3fb6a89bc3970c10c593b3d96fd1bab Mon Sep 17 00:00:00 2001 From: glax Date: Thu, 24 Aug 2023 12:13:34 +0200 Subject: [PATCH] Fixed missing filelogger crash --- Logging/Logger.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Logging/Logger.cs b/Logging/Logger.cs index 9ca3d28..f250d5b 100644 --- a/Logging/Logger.cs +++ b/Logging/Logger.cs @@ -20,7 +20,7 @@ public class Logger : TextWriter this.Encoding = encoding ?? Encoding.ASCII; if (enabledLoggers.Contains(LoggerType.FileLogger) && logFilePath is not null) _fileLogger = new FileLogger(logFilePath, encoding); - else + else if(enabledLoggers.Contains(LoggerType.FileLogger) && logFilePath is null) { _fileLogger = null; throw new ArgumentException($"logFilePath can not be null for LoggerType {LoggerType.FileLogger}");