You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2018/11/02 07:35:24 UTC

[GitHub] ymwneu commented on a change in pull request #518: [ISSUE #406]Fix NPE exception

ymwneu commented on a change in pull request #518: [ISSUE #406]Fix NPE exception
URL: https://github.com/apache/rocketmq/pull/518#discussion_r230289356
 
 

 ##########
 File path: tools/src/main/java/org/apache/rocketmq/tools/admin/DefaultMQAdminExtImpl.java
 ##########
 @@ -842,7 +842,7 @@ public boolean consumed(final MessageExt msg,
                 BrokerData brokerData = ci.getBrokerAddrTable().get(mq.getBrokerName());
                 if (brokerData != null) {
                     String addr = brokerData.getBrokerAddrs().get(MixAll.MASTER_ID);
-                    if (addr.equals(RemotingUtil.socketAddress2String(msg.getStoreHost()))) {
+                    if (RemotingUtil.socketAddress2String(msg.getStoreHost()).equals(addr)) {
 
 Review comment:
   Method DefaultMQAdminExtImpl#consumed is only invoked by DefaultMQAdminExtImpl#messageTrackDetail. If msg is NULL, the NPE will throw in front. so if the code execute to this line, we can insure msg is not null.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services