sacOO7 / socketcluster-client-java

Native java and android client for socketcluster framework in node.js
http://socketcluster.io/
Apache License 2.0
94 stars 43 forks source link

Fix NPE when calling disconnect() #29

Closed XDex closed 6 years ago

XDex commented 6 years ago

When calling disconnect() ws reference may be null, and the following exception might be raised:

ava.lang.NullPointerException: Attempt to invoke virtual method 'com.neovisionaries.ws.client.WebSocket com.neovisionaries.ws.client.WebSocket.disconnect()' on a null object reference
        at android.app.ActivityThread.handleUnbindService(ActivityThread.java:3473)
        at android.app.ActivityThread.-wrap27(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1693)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6541)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'com.neovisionaries.ws.client.WebSocket com.neovisionaries.ws.client.WebSocket.disconnect()' on a null object reference
        at io.github.sac.Socket.disconnect(Socket.java:546)
XDex commented 6 years ago

@sacOO7 Could you please merge this and publish a minor release with the fix? Thanks!

XDex commented 6 years ago

Bumping, @sacOO7 any update on this?

XDex commented 6 years ago

@sacOO7 Thanks for merging, could you please publish a new release to Maven? Thanks!

bipul-agarwal commented 6 years ago

@sacOO7 Bumping this up. Can you perform a minor release to Maven, so that we can integrate the fix in our application? Thx!!

sacOO7 commented 6 years ago

Hi @XDex , will be bumping up version with major updates...

sacOO7 commented 6 years ago

Hi @XDex @bipul-agarwal , Uploaded new library on maven. Please check it out ....