fix: CS8604 nullable warning in TodoApp.Avalonia LoggingHandler#544
Open
TemRevil wants to merge 2 commits into
Open
fix: CS8604 nullable warning in TodoApp.Avalonia LoggingHandler#544TemRevil wants to merge 2 commits into
TemRevil wants to merge 2 commits into
Conversation
WriteContentAsync declared a non-nullable HttpContent parameter but both call sites pass HttpContent? (request.Content / response.Content), which raised CS8604 in every TodoApp.Avalonia CI build since the samples got CI coverage. The method already null-checks, so the parameter type just needed to match actual usage.
Author
|
@dotnet-policy-service agree |
adrianhall
approved these changes
Jul 10, 2026
| private static async Task WriteContentAsync(HttpContent content, CancellationToken cancellationToken = default) | ||
| private static async Task WriteContentAsync(HttpContent? content, CancellationToken cancellationToken = default) | ||
| { | ||
| if (content != null) |
Collaborator
There was a problem hiding this comment.
Since content is now not nullable, the if (content != null) on line 40 is no longer required and can be replace by an Assert statement.
Collaborator
|
Overall - love the change - congrats on your first resolution. Decide whether you want to fix the small change suggested and let me know. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #520
WriteContentAsyncdeclared a non-nullableHttpContentparameter, but both call sites passHttpContent?(request.Contentandresponse.Content), so everyTodoApp.Avaloniabuild logged CS8604 once the samples gained CI coverage in #511/#519.As suggested in the issue, the parameter is now
HttpContent?— the method already null-checks, so there is no behavior change.Verified with
dotnet buildon theTodoApp.Avaloniaproject (net10.0): build succeeds with zero CS8604 warnings.