You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/06/21 08:41:24 UTC

[GitHub] [pulsar-client-node] gaoran10 commented on a diff in pull request #219: Add null check for consumer in MessageListenerProxy

gaoran10 commented on code in PR #219:
URL: https://github.com/apache/pulsar-client-node/pull/219#discussion_r902334147


##########
src/Consumer.cc:
##########
@@ -63,7 +63,9 @@ void MessageListenerProxy(Napi::Env env, Napi::Function jsCallback, MessageListe
   Consumer *consumer = data->consumer;
   delete data;
 
-  jsCallback.Call({msg, consumer->Value()});
+  if (consumer) {

Review Comment:
   Do we need to print some error messages when the consumer is a null value?



##########
src/Consumer.cc:
##########
@@ -63,7 +63,9 @@ void MessageListenerProxy(Napi::Env env, Napi::Function jsCallback, MessageListe
   Consumer *consumer = data->consumer;
   delete data;
 
-  jsCallback.Call({msg, consumer->Value()});
+  if (consumer) {

Review Comment:
   Do we need to print some warning messages when the consumer is a null value?



-- 
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: dev-unsubscribe@pulsar.apache.org

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