Skip to content

Commit 65ce4a1

Browse files
committed
Rollback Refactor
1 parent 9e188c5 commit 65ce4a1

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Serilog.Sinks.Console/Sinks/SystemConsole/Themes/AnsiConsoleTheme.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ public class AnsiConsoleTheme : ConsoleTheme
5050
/// <exception cref="ArgumentNullException">When <paramref name="styles"/> is <code>null</code></exception>
5151
public AnsiConsoleTheme(IReadOnlyDictionary<ConsoleThemeStyle, string> styles)
5252
{
53-
_styles = styles?.ToDictionary(kv => kv.Key, kv => kv.Value) ?? throw new ArgumentNullException(nameof(styles));
53+
if (styles == null) throw new ArgumentNullException(nameof(styles));
54+
_styles = styles.ToDictionary(kv => kv.Key, kv => kv.Value);
5455
}
5556

5657
/// <inheritdoc/>

src/Serilog.Sinks.Console/Sinks/SystemConsole/Themes/SystemConsoleTheme.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public class SystemConsoleTheme : ConsoleTheme
4747
/// <exception cref="ArgumentNullException">When <paramref name="styles"/> is <code>null</code></exception>
4848
public SystemConsoleTheme(IReadOnlyDictionary<ConsoleThemeStyle, SystemConsoleThemeStyle> styles)
4949
{
50-
Styles = styles?.ToDictionary(kv => kv.Key, kv => kv.Value) ?? throw new ArgumentNullException(nameof(styles));
50+
if (styles == null) throw new ArgumentNullException(nameof(styles));
51+
Styles = styles.ToDictionary(kv => kv.Key, kv => kv.Value);
5152
}
5253

5354
/// <inheritdoc/>

0 commit comments

Comments
 (0)