Author: clebert.suconic(a)jboss.com
Date: 2011-12-20 09:02:24 -0500 (Tue, 20 Dec 2011)
New Revision: 11915
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
Log:
JBPAPP-7792 - avoiding a NPE
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-12-19
17:57:47 UTC (rev 11914)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java 2011-12-20
14:02:24 UTC (rev 11915)
@@ -562,12 +562,20 @@
public void onConnection(ClientSessionFactoryInternal sf)
{
TopologyMember localMember = getLocalMember();
- sf.sendNodeAnnounce(localMember.getUniqueEventID(),
- manager.getNodeId(),
- false,
- localMember.getConnector().getA(),
- localMember.getConnector().getB());
+ if (localMember != null)
+ {
+ sf.sendNodeAnnounce(localMember.getUniqueEventID(),
+ manager.getNodeId(),
+ false,
+ localMember.getConnector().getA(),
+ localMember.getConnector().getB());
+ }
+ else
+ {
+ log.warn("LocalMember is not set at on ClusterConnection " + this);
+ }
+ // TODO: shouldn't we send the current time here? and change the current
topology?
// sf.sendNodeAnnounce(System.currentTimeMillis(),
// manager.getNodeId(),
// false,