Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting crash - Attempt to invoke virtual method addMessageStatusListener on a null object reference #67

Open
AnandKuhar1100 opened this issue Sep 20, 2023 · 0 comments

Comments

@AnandKuhar1100
Copy link

Logs -
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.quickblox.chat.QBMessageStatusesManager.addMessageStatusListener(com.quickblox.chat.listeners.QBMessageStatusListener)' on a null object reference
at com.quickblox.reactnative.chat.ChatModule.addMessageStatusListener(ChatModule.java:125)
at com.quickblox.reactnative.chat.ChatModule.access$700(ChatModule.java:58)
at com.quickblox.reactnative.chat.ChatModule$1.onSuccess(ChatModule.java:208)
at com.quickblox.reactnative.chat.ChatModule$1.onSuccess(ChatModule.java:202)
at com.quickblox.core.helper.CommonUtils.notifyEntityCallbackOnSuccess(:2)
at com.quickblox.chat.QBChatService$4.run(:5)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:226)
at android.app.ActivityThread.main(ActivityThread.java:7592)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

We are getting this crash. I checked native android files for quickblox-react-native-sdk and figure out that addMessageStatusListener is fired when connect (inside ChatModule.java) method returns success.
Inside addMessageStatusListener method we are using QBMessageStatusesManager instance. We are getting this instance as null.
This can be null only if this.connection (Inside QBChatServices.class) is not connected or not authenticated. We are connecting and authenticating user inside login method in QBChatService.class. May be either connection is not successful or user is not authenticated and "connect" method returns success and we are getting crash. Please help in resolving this crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant