diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeImpl.java index 5e0eb17584..e40bc467f9 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/BridgeImpl.java @@ -1014,17 +1014,18 @@ public class BridgeImpl implements Bridge, SessionFailureListener, SendAcknowled // To be called by the topology update // This logic will be updated on the cluster connection protected void nodeUP(TopologyMember member, boolean last) { - ClientSessionInternal sessionToUse = session; - RemotingConnection connectionToUse = sessionToUse != null ? sessionToUse.getConnection() : null; - - if (member != null && this.targetNodeID != null && this.targetNodeID.equals(member.getNodeId())) { - // this could be an update of the topology say after a backup started - BridgeImpl.this.targetNode = member; - } else { - // we don't need synchronization here, but we need to make sure we won't get a NPE on races - if (connectionToUse != null && member.isMember(connectionToUse)) { - this.targetNode = member; - this.targetNodeID = member.getNodeId(); + if (member != null) { + ClientSessionInternal sessionToUse = session; + RemotingConnection connectionToUse = sessionToUse != null ? sessionToUse.getConnection() : null; + if (this.targetNodeID != null && this.targetNodeID.equals(member.getNodeId())) { + // this could be an update of the topology say after a backup started + BridgeImpl.this.targetNode = member; + } else { + // we don't need synchronization here, but we need to make sure we won't get a NPE on races + if (connectionToUse != null && member.isMember(connectionToUse)) { + this.targetNode = member; + this.targetNodeID = member.getNodeId(); + } } }