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 in com.onesignal.language.LanguageContext.getLanguage after calling pauseInAppMessages() #2105

Open
1 task done
chokokatana opened this issue May 31, 2024 · 3 comments

Comments

@chokokatana
Copy link

chokokatana commented May 31, 2024

What happened?

Got crash from user in the field who after reaching a certain part of the registration flow called pauseInAppMessages(false) to enable in app messages.

Steps to reproduce?

No reproducible steps.

What did you expect to happen?

No crash.

OneSignal Android SDK version

4.8.9

Android version

14

Specific Android models

* Google Pixel 8, Android 14

Relevant log output

Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'java.lang.Object n3.c.H' on a null object reference in method 'java.lang.String com.onesignal.k0.r0(com.onesignal.l0)'
       at com.onesignal.language.LanguageContext.getLanguage(LanguageContext.java:38)
       at com.onesignal.OSInAppMessageController.variantIdForMessage(OSInAppMessageController.java:277)
       at com.onesignal.OSInAppMessageController.displayMessage(OSInAppMessageController.java:807)
       at com.onesignal.OSInAppMessageController.attemptToShowInAppMessage(OSInAppMessageController.java:649)
       at com.onesignal.OSInAppMessageController.queueMessageForDisplay(OSInAppMessageController.java:633)
       at com.onesignal.OSInAppMessageController.evaluateInAppMessages(OSInAppMessageController.java:270)
       at com.onesignal.OSInAppMessageController.setInAppMessagingEnabled(OSInAppMessageController.java:1029)
       at com.onesignal.OneSignal.pauseInAppMessages(OneSignal.java:3163)
       at com.geodb.wallace.utils.SlowSignal$Companion$activateInAppMessages$1$1$1.invokeSuspend(SlowSignal.kt:100)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
       at android.os.Handler.handleCallback(Handler.java:959)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loopOnce(Looper.java:232)
       at android.os.Looper.loop(Looper.java:317)
       at android.app.ActivityThread.main(ActivityThread.java:8501)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

Code of Conduct

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

Thanks for reaching out @chokokatana! We'll look into this and get back to you as soon as possible.

@jkasten2
Copy link
Member

@chokokatana do you call OneSignal.setLanguage() in your app?

Do you see this issue if you upgrade to the latest OneSignal-Android-SDK 5.x.x version?

@chokokatana
Copy link
Author

  • No
  • Can't test.

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

3 participants