You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2019/05/15 15:14:23 UTC

[activemq-artemis] branch master updated: ARTEMIS-2334 avoid potential NPE

This is an automated email from the ASF dual-hosted git repository.

clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


The following commit(s) were added to refs/heads/master by this push:
     new 984a901  ARTEMIS-2334 avoid potential NPE
     new c24248a  This closes #2668
984a901 is described below

commit 984a901d6a7dcc9d5987c6ba34f0ceef8868c5c2
Author: Justin Bertram <jb...@apache.org>
AuthorDate: Tue May 14 09:58:37 2019 -0500

    ARTEMIS-2334 avoid potential NPE
---
 .../artemis/core/management/impl/ActiveMQServerControlImpl.java         | 2 +-
 .../artemis/core/server/cluster/impl/ClusterConnectionImpl.java         | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index b19a0b9..f4ad3b5 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -3396,7 +3396,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
       if (AuditLogger.isEnabled()) {
          AuditLogger.getNodeID(this.server);
       }
-      return server.getNodeID().toString();
+      return server.getNodeID() == null ? null : server.getNodeID().toString();
    }
 
    @Override
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
index 1950418..6ee2da4 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
@@ -542,7 +542,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
    @Override
    public String getNodeID() {
-      return nodeManager.getNodeId().toString();
+      return nodeManager == null ? null : (nodeManager.getNodeId() == null ? null : nodeManager.getNodeId().toString());
    }
 
    @Override