Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nil pointer error on schemaregistry/serde/protobuf/protobuf.go #997

Merged
merged 2 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Confluent's Golang client for Apache Kafka

# v2.2.0

This is a feature release.

## Fixes

* Fixes a nil pointer bug in the protobuf `Serializer.Serialize()`, caused due to
an unchecked error (#997, @baganokodo2022).


## v2.1.1

This is a maintenance release.
Expand Down
2 changes: 1 addition & 1 deletion schemaregistry/serde/protobuf/protobuf.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ func (s *Serializer) Serialize(topic string, msg interface{}) ([]byte, error) {

func (s *Serializer) toProtobufSchema(msg proto.Message) (*desc.FileDescriptor, map[string]string, error) {
messageDesc, err := desc.LoadMessageDescriptorForMessage(protoV1.MessageV1(msg))
fileDesc := messageDesc.GetFile()
if err != nil {
return nil, nil, err
}
fileDesc := messageDesc.GetFile()
deps := make(map[string]string)
err = s.toDependencies(fileDesc, deps)
if err != nil {
Expand Down