From fc658c3805edb912729005927a52a6a44dc6d862 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Thu, 12 Jul 2012 11:29:40 -0700 Subject: [PATCH] Fixing NPE --- .../jetty/websocket/protocol/Parser.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/protocol/Parser.java b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/protocol/Parser.java index 2ed4f647140..3fce2431fea 100644 --- a/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/protocol/Parser.java +++ b/jetty-websocket/websocket-core/src/main/java/org/eclipse/jetty/websocket/protocol/Parser.java @@ -456,15 +456,22 @@ public class Parser public String toString() { StringBuilder builder = new StringBuilder(); - builder.append("Parser ["); - builder.append(incomingFramesHandler.getClass().getSimpleName()); - builder.append(", state="); + builder.append("Parser["); + if (incomingFramesHandler == null) + { + builder.append("NO_HANDLER"); + } + else + { + builder.append(incomingFramesHandler.getClass().getSimpleName()); + } + builder.append(",s="); builder.append(state); - builder.append(", cursor="); + builder.append(",c="); builder.append(cursor); - builder.append(", payloadLength="); + builder.append(",len="); builder.append(payloadLength); - builder.append(", frame="); + builder.append(",f="); builder.append(frame); builder.append("]"); return builder.toString();