Skip to content

Commit 489aaed

Browse files
committed
Prefer to use Bang operator
1 parent a238a59 commit 489aaed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Serilog.Sinks.Console/Sinks/SystemConsole/Output/EventPropertyTokenRenderer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public override void Render(LogEvent logEvent, TextWriter output)
6262

6363
if (_token.Alignment.HasValue)
6464
{
65-
var str = writer.ToString() ?? throw new InvalidOperationException("The output TextWriter, return a invalid state.");
65+
var str = writer.ToString()!;
6666
Padding.Apply(output, str, _token.Alignment);
6767
}
6868
}

0 commit comments

Comments
 (0)