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]: Caused by java.lang.NullPointerException: null cannot be cast to non-null type kotlin.String #684

Closed
1 task done
ajaybirla-fabzen opened this issue Jan 13, 2024 · 1 comment

Comments

@ajaybirla-fabzen
Copy link

What happened?

The application crashes whenever it receives a notification.

Steps to reproduce?

1. Launch the application.
2. Send a notification to the application.
3. Click on the notification.
4. Observe the application crash.

What did you expect to happen?

I expect the app to not crash whenever it receives a notification.

Unity version

2021.3.17f1

OneSignal Unity SDK version

5.0.5

Platform

Android

Relevant log output

Caused by java.lang.NullPointerException: null cannot be cast to non-null type kotlin.String
       at com.onesignal.common.modeling.Model.getStringProperty(Model.kt:216)
       at com.onesignal.common.modeling.Model.getStringProperty$default(Model.kt:216)
       at com.onesignal.common.modeling.Model.getId(Model.kt:62)
       at com.onesignal.common.modeling.ModelStore.get(ModelStore.kt:63)
       at com.onesignal.common.modeling.SingletonModelStore.getModel(SingletonModelStore.kt:22)
       at com.onesignal.inAppMessages.internal.InAppMessagesManager.fetchMessages(InAppMessagesManager.kt:216)
       at com.onesignal.inAppMessages.internal.InAppMessagesManager.access$fetchMessages(InAppMessagesManager.kt:50)
       at com.onesignal.inAppMessages.internal.InAppMessagesManager$onModelReplaced$1.invokeSuspend(InAppMessagesManager.kt:185)
       at com.onesignal.inAppMessages.internal.InAppMessagesManager$onModelReplaced$1.invoke(:8)
       at com.onesignal.inAppMessages.internal.InAppMessagesManager$onModelReplaced$1.invoke(:2)
       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:284)
       at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
       at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
       at kotlinx.coroutines.BuildersKt.runBlocking(:1)
       at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
       at kotlinx.coroutines.BuildersKt.runBlocking$default(: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)

Code of Conduct

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

Thanks for reporting, this should be fixed in the latest Unity SDK 5.1.1 Release. Feel free to tag me if you are still seeing this issue

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