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

[Bug]: Crash NPE in InAppMessagesManager.fetchMessages #1921

Closed
1 task done
sarbyn opened this issue Nov 27, 2023 · 2 comments
Closed
1 task done

[Bug]: Crash NPE in InAppMessagesManager.fetchMessages #1921

sarbyn opened this issue Nov 27, 2023 · 2 comments

Comments

@sarbyn
Copy link

sarbyn commented Nov 27, 2023

What happened?

Fatal Exception: java.lang.NullPointerException: Attempt to invoke interface method 'int java.lang.CharSequence.length()' on a null object reference
       at com.onesignal.inAppMessages.internal.InAppMessagesManager.fetchMessages(InAppMessagesManager.kt:215)
       at com.onesignal.inAppMessages.internal.InAppMessagesManager.access$showMultiplePrompts(InAppMessagesManager.kt:50)
       at com.onesignal.inAppMessages.internal.InAppMessagesManager.access$fetchMessages(InAppMessagesManager.kt:50)
       at com.onesignal.inAppMessages.internal.InAppMessagesManager$onModelReplaced$1.invokeSuspend(InAppMessagesManager.kt:181)
       at com.onesignal.inAppMessages.internal.InAppMessagesManager$onModelReplaced$1.invoke(InAppMessagesManager.kt:2)
       at com.onesignal.inAppMessages.internal.InAppMessagesManager$onModelReplaced$1.invoke(InAppMessagesManager.kt:1)
       at com.onesignal.common.threading.ThreadUtilsKt$suspendifyOnThread$1$1.invokeSuspend(ThreadUtils.kt:61)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
       at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:280)
       at kotlinx.coroutines.BlockingCoroutine.joinBlocking(BlockingCoroutine.java:85)
       at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(BuildersKt__Builders.kt:59)
       at kotlinx.coroutines.BuildersKt.runBlocking(Builders.kt:1)
       at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(BuildersKt__Builders.kt:38)
       at kotlinx.coroutines.BuildersKt.runBlocking$default(Builders.kt:1)
       at com.onesignal.common.threading.ThreadUtilsKt$suspendifyOnThread$1.invoke(ThreadUtils.kt:60)
       at com.onesignal.common.threading.ThreadUtilsKt$suspendifyOnThread$1.invoke(ThreadUtils.kt:59)
       at kotlin.concurrent.ThreadsKt$thread$thread$1.run(Thread.kt:30)

Steps to reproduce?

Version 5.0.2
We find this kind of crash on production, not on our test devices

What did you expect to happen?

No crash

OneSignal Android SDK version

5.0.2

Android version

13, 12, 11, 10, 9, 8, 7.0

Specific Android models

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jennantilla
Copy link
Contributor

@sarbyn thanks for reaching out! We'll investigate this and get back to you as soon as possible.

@jfishman1
Copy link
Contributor

This should be fixed in the latest 5.1.2 https://github.com/OneSignal/OneSignal-Android-SDK/releases

Please let us know if you continue to see this issue and provide the full crash log including affected devices and operating system versions.

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

4 participants