diff --git a/src/OneWare.Core/Services/Logger.cs b/src/OneWare.Core/Services/Logger.cs index faf15ecf..463788a3 100644 --- a/src/OneWare.Core/Services/Logger.cs +++ b/src/OneWare.Core/Services/Logger.cs @@ -59,7 +59,7 @@ public void Log(object message, ConsoleColor color = default, bool writeOutput = public void Error(string message, Exception? exception = null, bool showOutput = true, bool showDialog = false, Window? dialogOwner = null) { - Log(message + "\n" + exception, ConsoleColor.Red); + Log(message + (exception != null ? $"\n{exception}" : ""), ConsoleColor.Red); if (showOutput && ContainerLocator.Container.IsRegistered()) Dispatcher.UIThread.Post(() => @@ -80,7 +80,7 @@ public void Error(string message, Exception? exception = null, bool showOutput = public void Warning(string message, Exception? exception = null, bool showOutput = true, bool showDialog = false, Window? dialogOwner = null) { - Log(message + "\n" + exception, ConsoleColor.Yellow); + Log(message + (exception != null ? $"\n{exception}" : ""), ConsoleColor.Yellow); if (showOutput && ContainerLocator.Container.IsRegistered()) {