diff --git a/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java b/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java index 1ee0829e87..0f053bbd12 100644 --- a/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java +++ b/activemq-web/src/main/java/org/apache/activemq/web/MessageListenerServlet.java @@ -416,14 +416,18 @@ public class MessageListenerServlet extends MessageServletSupport { if (message instanceof TextMessage) { TextMessage textMsg = (TextMessage)message; String txt = textMsg.getText(); - if (txt.startsWith("") + 2); + if (txt != null) { + if (txt.startsWith("") + 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(""); }