You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/07/27 17:02:29 UTC

[GitHub] [pulsar-client-go] cckellogg commented on a change in pull request #575: Avoid parsing nil msg.Value

cckellogg commented on a change in pull request #575:
URL: https://github.com/apache/pulsar-client-go/pull/575#discussion_r677638882



##########
File path: pulsar/producer_partition.go
##########
@@ -353,7 +353,7 @@ func (p *partitionProducer) internalSend(request *sendRequest) {
 	payload := msg.Payload
 	var schemaPayload []byte
 	var err error
-	if p.options.Schema != nil {
+	if p.options.Schema != nil && msg.Value != nil {

Review comment:
       should this be checked within in the if statement and then log an error and return?
   ```
   if p.options.Schema != nil {
     if msg.Value == nil {
       p.log.WithError(err).Errorf("Schema encode message failed nil message")
       return
     }
   
   }
   ```
   
   Or should the ecoders be able to handle a nil value and return an error?
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org