tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1422334 - /tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java
Date Sat, 15 Dec 2012 19:57:41 GMT
Author: markt
Date: Sat Dec 15 19:57:41 2012
New Revision: 1422334

URL: http://svn.apache.org/viewvc?rev=1422334&view=rev
Log:
Avoid NPE

Modified:
    tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java

Modified: tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java?rev=1422334&r1=1422333&r2=1422334&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/websocket/PojoMethodMapping.java Sat Dec 15 19:57:41
2012
@@ -117,7 +117,7 @@ public class PojoMethodMapping {
             Session session) {
         Set<MessageHandler> result = new HashSet<>();
         for (MessageMethod messageMethod : onMessage) {
-            result.add(messageMethod.getMessageHandler(pojo, pathInfo,session));
+            result.add(messageMethod.getMessageHandler(pojo, pathInfo, session));
         }
         return result;
     }
@@ -331,7 +331,12 @@ public class PojoMethodMapping {
                 Session session) {
             Object[] params = new Object[m.getParameterTypes().length];
 
-            Map<String,String> pathParams = template.match(pathInfo);
+            Map<String,String> pathParams;
+            if (template == null) {
+                pathParams = new HashMap<>();
+            } else {
+                pathParams = template.match(pathInfo);
+            }
 
             for (Map.Entry<Integer,PathParam> entry :
                     indexPathParams.entrySet()) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message