activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1342618 - /activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java
Date Fri, 25 May 2012 13:31:58 GMT
Author: tabish
Date: Fri May 25 13:31:58 2012
New Revision: 1342618

URL: http://svn.apache.org/viewvc?rev=1342618&view=rev
Log:
fix for: https://issues.apache.org/jira/browse/AMQ-3856

Modified:
    activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java

Modified: activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java?rev=1342618&r1=1342617&r2=1342618&view=diff
==============================================================================
--- activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java
(original)
+++ activemq/trunk/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java
Fri May 25 13:31:58 2012
@@ -416,14 +416,18 @@ public class MessageListenerServlet exte
         if (message instanceof TextMessage) {
             TextMessage textMsg = (TextMessage)message;
             String txt = textMsg.getText();
-            if (txt.startsWith("<?")) {
-                txt = txt.substring(txt.indexOf("?>") + 2);
+            if (txt != null) {
+                if (txt.startsWith("<?")) {
+                    txt = txt.substring(txt.indexOf("?>") + 2);
+                }
+                writer.print(txt);
             }
-            writer.print(txt);
         } else if (message instanceof ObjectMessage) {
             ObjectMessage objectMsg = (ObjectMessage)message;
             Object object = objectMsg.getObject();
-            writer.print(object.toString());
+            if (object != null) {
+                writer.print(object.toString());
+            }
         }
         writer.println("</response>");
     }



Mime
View raw message