Within triggerRefreshOnConnected() a call is made to MessageRepository.findAll(), however the callback for success calls a listener that can be null at this point:
java.lang.NullPointerException: Attempt to invoke interface method 'void nu.parley.android.b.d()' on a null object reference
at nu.parley.android.Parley$3$1.onSuccess(Parley.java:486)
at nu.parley.android.Parley$3$1.onSuccess(Parley.java:469)
at nu.parley.android.data.repository.MessageRepository$1.onResponse(MessageRepository.java:35)
at retrofit2.DefaultCallAdapterFactory$ExecutorCallbackCall$1$1.run(DefaultCallAdapterFactory.java:83)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:210)
at android.os.Looper.loop(Looper.java:299)
at android.app.ActivityThread.main(ActivityThread.java:8087)
at java.lang.reflect.Method.invoke(Method.java:-2)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1045)
Might be worthwhile to not even call MessageRepository.findAll() if the listener is not set? But nevertheless due to concurrency a null-check will be required anyways.
I'm on a small vacation so this time I cannot create a pull-request for this issue :)
Within
triggerRefreshOnConnected()
a call is made toMessageRepository.findAll()
, however the callback for success calls a listener that can be null at this point:https://github.com/parley-messaging/android-library/blob/4f18c5f26518ae7b8970ea56936e7e62954ea7a1/parley/src/main/java/nu/parley/android/Parley.java#L486
Might be worthwhile to not even call
MessageRepository.findAll()
if the listener is not set? But nevertheless due to concurrency a null-check will be required anyways.I'm on a small vacation so this time I cannot create a pull-request for this issue :)