Skip to content

Fix NullReferenceException in PopulateGrpcTrailers#581

Merged
haga-rak merged 1 commit into
mainfrom
fix/grpc-trailer-null-reference
Mar 20, 2026
Merged

Fix NullReferenceException in PopulateGrpcTrailers#581
haga-rak merged 1 commit into
mainfrom
fix/grpc-trailer-null-reference

Conversation

@haga-rak
Copy link
Copy Markdown
Owner

Summary

  • Fix NullReferenceException in ResponseProtobufProducer.PopulateGrpcTrailers when gRPC response trailers exist but do not contain grpc-status or grpc-message headers
  • FirstOrDefault() on HeaderFieldInfo (a reference type) returns null when no match is found; the existing code accessed .Name.Length on the null result, causing the crash
  • Replace .Name.Length > 0 checks with proper null checks
  • Add regression test using a reproducing archive

…ailers

FirstOrDefault() on HeaderFieldInfo (a reference type) returns null when
no matching grpc-status/grpc-message trailer is found. The existing code
accessed .Name.Length on the null result, causing a NullReferenceException.
Replace the .Name.Length > 0 checks with null checks.
@haga-rak haga-rak merged commit 64fcd67 into main Mar 20, 2026
0 of 2 checks passed
@haga-rak haga-rak deleted the fix/grpc-trailer-null-reference branch March 20, 2026 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant