diff --git a/samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/Services/LoggingHandler.cs b/samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/Services/LoggingHandler.cs index 971ee140..5d0bc3c9 100644 --- a/samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/Services/LoggingHandler.cs +++ b/samples/todoapp/TodoApp.Avalonia/TodoApp.Avalonia/Services/LoggingHandler.cs @@ -35,11 +35,9 @@ protected override async Task SendAsync(HttpRequestMessage return response; } - private static async Task WriteContentAsync(HttpContent content, CancellationToken cancellationToken = default) + private static async Task WriteContentAsync(HttpContent? content, CancellationToken cancellationToken = default) { - if (content != null) - { - Debug.WriteLine($"[HTTP] >>> {await content.ReadAsStringAsync(cancellationToken)}"); - } + Debug.Assert(content != null, "Request/response content should never be null here."); + Debug.WriteLine($"[HTTP] >>> {await content.ReadAsStringAsync(cancellationToken)}"); } }