484397 - Unavoidable NullPointerException in onMessage-Handler for PongMessages

This commit is contained in:
Joakim Erdfelt 2015-12-17 15:31:50 -07:00
parent e6901b2646
commit 5f27a62aae
1 changed files with 6 additions and 0 deletions

View File

@ -22,6 +22,8 @@ import java.nio.ByteBuffer;
import javax.websocket.PongMessage;
import org.eclipse.jetty.util.BufferUtil;
public class JsrPongMessage implements PongMessage
{
private final ByteBuffer data;
@ -34,6 +36,10 @@ public class JsrPongMessage implements PongMessage
@Override
public ByteBuffer getApplicationData()
{
if (data == null)
{
return BufferUtil.EMPTY_BUFFER;
}
return data.slice();
}
}