Skip to content

NullPointerException in engineio parser callback #27

@gayatrimali

Description

@gayatrimali

I am using latest socket.io-client.java library in my android client. It internally uses engine.io-client.java 0.5.1 version. This library is giving NPE while sending a packet. Following is the stack trace. Please fix it soon. According to the stack trace, error is thrown in the following line.
self.ws.sendMessage(TEXT, new Buffer().writeUtf8((String) packet));
Can self.ws object be null in any scenario ?

java.lang.NullPointerException:
at com.github.nkzawa.engineio.client.transports.WebSocket$2.void call(java.lang.Object)()(SourceFile:148)
at com.github.nkzawa.engineio.parser.Parser.void encodePacket(com.github.nkzawa.engineio.parser.Packet,boolean,com.github.nkzawa.engineio.parser.Parser$EncodeCallback)()(SourceFile:63)
at com.github.nkzawa.engineio.parser.Parser.void encodePacket(com.github.nkzawa.engineio.parser.Packet,com.github.nkzawa.engineio.parser.Parser$EncodeCallback)()(SourceFile:42)
at com.github.nkzawa.engineio.client.transports.WebSocket.void write(com.github.nkzawa.engineio.parser.Packet[])()(SourceFile:143)
at com.github.nkzawa.engineio.client.Transport$3.void run()()(SourceFile:101)
at com.github.nkzawa.thread.EventThread.void exec(java.lang.Runnable)()(SourceFile:50)
at com.github.nkzawa.engineio.client.Transport.void send(com.github.nkzawa.engineio.parser.Packet[])()(SourceFile:97)
at com.github.nkzawa.engineio.client.Socket.void flush()()(SourceFile:611)
at com.github.nkzawa.engineio.client.Socket.void onDrain()()(SourceFile:602)
at com.github.nkzawa.engineio.client.Socket.void access$1000(com.github.nkzawa.engineio.client.Socket)()(SourceFile:30)
void access$1600(com.github.nkzawa.engineio.client.Socket,java.lang.String)
at com.github.nkzawa.engineio.client.Socket$6.void call(java.lang.Object[])()(SourceFile:295)
at com.github.nkzawa.emitter.Emitter.com.github.nkzawa.emitter.Emitter emit(java.lang.String,java.lang.Object[])()(SourceFile:117)
at com.github.nkzawa.engineio.client.transports.WebSocket$3.void run()()(SourceFile:163)
at com.github.nkzawa.thread.EventThread$2.void run()()(SourceFile:75)
at java.util.concurrent.ThreadPoolExecutor.runWorker()(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run()(ThreadPoolExecutor.java:587)
at java.lang.Thread.run()(Thread.java:848)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions