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

App crash: java.lang.NullPointerException Attempt to invoke virtual method 'java.lang.String com.exponea.sdk.models.InAppMessagePayload.getImageUrl()' on a null object reference com.exponea.sdk.manager.InAppMessageManagerImpl.hasImageFor #33

Closed
nkartyshov opened this issue Dec 23, 2020 · 3 comments

Comments

@nkartyshov
Copy link

nkartyshov commented Dec 23, 2020

Hello, Android app crashes, when using Exponea SDK:

Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.exponea.sdk.models.InAppMessagePayload.getImageUrl()' on a null object reference
       at com.exponea.sdk.manager.InAppMessageManagerImpl.hasImageFor(InAppMessageManagerImpl.java:4)
       at com.exponea.sdk.manager.InAppMessageManagerImpl.getFilteredMessages(InAppMessageManagerImpl.java:124)
       at com.exponea.sdk.manager.InAppMessageManagerImpl.getRandom(InAppMessageManagerImpl.java:10)
       at com.exponea.sdk.manager.InAppMessageManager$DefaultImpls.getRandom$default(InAppMessageManager.java:7)
       at com.exponea.sdk.manager.InAppMessageManagerImpl$showRandom$1.invokeSuspend(InAppMessageManagerImpl.java:31)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(BaseContinuationImpl.java:9)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.java:93)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.java)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.java:14)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.java:28)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.java)

Exponea SDK versions: v2.7.4 and v2.9.0
Android versions: 11, 10, 9, 8
Device: Samsung A51, A50, S10, etc, Nokia 6.1, 7+, etc

Crash occurs when the application is in the background.

@wassil
Copy link
Contributor

wassil commented Jan 4, 2021

Hi,
are you using AB testing for in-app messages by any chance?
There is an open issue with AB testing for in-app messages. Control group of AB tests has null payload and results in this crash.
My advice is to disable AB testing or set it up so that there is 0% in the control group.

@nkartyshov
Copy link
Author

nkartyshov commented Jan 11, 2021

Hi.
Yes, i was created control groups on 50% user show in-app massage.

@wassil
Copy link
Contributor

wassil commented Jan 18, 2021

The issue around in-app messages control groups is currently being worked on. We'll ping you once there is a solution.
For now, please don't AB test in-app messages.

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

2 participants