Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=50591
authorkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 15 Jan 2011 17:43:46 +0000 (17:43 +0000)
committerkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 15 Jan 2011 17:43:46 +0000 (17:43 +0000)
Do not throw NullPointerException when ReplicationValve#filter is not set.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1059379 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/ha/tcp/ReplicationValve.java
webapps/docs/changelog.xml

index f352709..e2fca4d 100644 (file)
@@ -551,7 +551,8 @@ public class ReplicationValve
      * @return True if no session change
      */
     protected boolean isRequestWithoutSessionChange(String uri) {
-        return filter.matcher(uri).matches();
+        Pattern f = filter;
+        return f != null && f.matcher(uri).matches();
     }
 
     /**
index 99eee45..7075092 100644 (file)
@@ -80,6 +80,9 @@
   </subsection>
   <subsection name="Cluster">
     <changelog>
+      <fix>
+        <bug>50591</bug>: Fix NPE in ReplicationValve. (kkolinko)
+      </fix>
       <add>
         Internationalise the log messages for the FarmWarDeployer. (markt)
       </add>