Author: markt Date: Sun Jul 29 21:47:24 2012 New Revision: 1366959 URL: http://svn.apache.org/viewvc?rev=1366959&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53606 Fix possible NPE when sending pings between cluster nodes Based on a patch by F.Arnoud
Modified: tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java Modified: tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java?rev=1366959&r1=1366958&r2=1366959&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java (original) +++ tomcat/trunk/java/org/apache/catalina/tribes/group/interceptors/TcpPingInterceptor.java Sun Jul 29 21:47:24 2012 @@ -122,13 +122,16 @@ public class TcpPingInterceptor extends } protected void sendPing() { - if (failureDetector.get() != null) { + TcpFailureDetector tcpFailureDetector = + failureDetector != null ? failureDetector.get() : null; + if (tcpFailureDetector != null) { // We have a reference to the failure detector // Piggy back on it - failureDetector.get().checkMembers(true); + tcpFailureDetector.checkMembers(true); } else { - StaticMembershipInterceptor smi = staticMembers.get(); - if (staticOnly && smi != null) { + StaticMembershipInterceptor smi = + staticOnly && staticMembers != null ? staticMembers.get() : null; + if (smi != null) { sendPingMessage(smi.getMembers()); } else { sendPingMessage(getMembers()); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org