You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have observed NullPointerException in PusherWebsocketReactNativeModule multiple times on Android devices. This is mainly happening with PusherWebsocketReactNativeModule.onAuthorizer and PusherWebsocketReactNativeModule.disconnect. Please find the log mentioned below.
Fatal Exception: java.lang.NullPointerException:
at com.pusherwebsocketreactnative.PusherWebsocketReactNativeModule.onAuthorizer(PusherWebsocketReactNativeModule.kt:158)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
at java.lang.Thread.run(Thread.java:1012)
and
Fatal Exception: java.lang.NullPointerException:
at com.pusherwebsocketreactnative.PusherWebsocketReactNativeModule.disconnect(PusherWebsocketReactNativeModule.kt:90)
at java.lang.reflect.Method.invoke(Method.java)
at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:188)
at com.facebook.jni.NativeRunnable.run(NativeRunnable.java)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:27)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228)
at java.lang.Thread.run(Thread.java:920)
This is how I've initialized the Pusher instance in my App.js and I'm using "@pusher/pusher-websocket-react-native": "^1.2.2"
Also, I checked the generated Kotlin file for the PusherWebsocketReactNativeModule.kt. I can see the crash mainly happening in places where !! is used.
It would be great if we replaced the .!! with the .? operator or any better null handling (or custom Exception) here. so despite what configuration we've added at least it will not throw NullPointerException.
The text was updated successfully, but these errors were encountered:
@vishaledkey I got the same error as you. Before I build the release, I add try catch exception to that code. So the app will not crash but will no longer be able to use realtime pusher. Both Android and ios get this error
I have observed NullPointerException in
PusherWebsocketReactNativeModule
multiple times on Android devices. This is mainly happening withPusherWebsocketReactNativeModule.onAuthorizer
andPusherWebsocketReactNativeModule.disconnect
. Please find the log mentioned below.and
This is how I've initialized the Pusher instance in my App.js and I'm using
"@pusher/pusher-websocket-react-native": "^1.2.2"
Also, I checked the generated Kotlin file for the
PusherWebsocketReactNativeModule.kt
. I can see the crash mainly happening in places where!!
is used.It would be great if we replaced the
.!!
with the.?
operator or any better null handling (or custom Exception) here. so despite what configuration we've added at least it will not throwNullPointerException
.The text was updated successfully, but these errors were encountered: