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 2020/06/01 07:02:18 UTC

[GitHub] [pulsar] jiazhai commented on a change in pull request #7118: fix NullPointerException with SubscriptionMode.NonDurable

jiazhai commented on a change in pull request #7118:
URL: https://github.com/apache/pulsar/pull/7118#discussion_r433073210



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
##########
@@ -715,11 +715,11 @@ public void connectionOpened(final ClientCnx cnx) {
         }
 
         boolean isDurable = subscriptionMode == SubscriptionMode.Durable;
-        MessageIdData startMessageIdData;
+        MessageIdData startMessageIdData = null;
         if (isDurable) {
             // For regular durable subscriptions, the message id from where to restart will be determined by the broker.
             startMessageIdData = null;
-        } else {
+        } else if (startMessageId != null) {

Review comment:
       looks like in line 742 below, there is also a reference to `startMessageId`. Will it also throw NPE?




----------------------------------------------------------------
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.

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