Fix #437 - updates to NPE prevention

This commit is contained in:
Joakim Erdfelt 2016-04-13 13:40:14 -07:00
parent 210f9a8d7c
commit f28c58044e
1 changed files with 6 additions and 1 deletions

View File

@ -47,8 +47,13 @@ public class TextPartialMessage implements MessageAppender
@Override
public void appendFrame(ByteBuffer payload, boolean isLast) throws IOException
{
String msg = null;
// No decoders for Partial messages per JSR-356 (PFD1 spec)
partialHandler.onMessage(BufferUtil.toUTF8String(payload.slice()),isLast);
if (payload != null)
msg = BufferUtil.toUTF8String(payload.slice());
partialHandler.onMessage(msg, isLast);
}
@Override