You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using ConsentState.withConsentState(user.consentState) to create a builder to update consent in onUserIdentified. However, when user is FilteredMParticleUser this will crash because consentState returns null. Partial stacktrace:
java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.Map com.mparticle.consent.ConsentState.getGDPRConsentState()' on a null object reference
at com.mparticle.consent.ConsentState$Builder.<init>(SourceFile:15)
at com.mparticle.consent.ConsentState$Builder.<init>(SourceFile:1)
at com.mparticle.consent.ConsentState.withConsentState(SourceFile:1)
This should likely be caught at compile-time, since ConsentState.withConsentState requires a non-null ConsentState. However, the problem is that MParticleUser.getConsentState() is annotated as NonNull, so the Kotlin compiler trusts the annotation, while the FilteredMParticleUserimplementation returns null.
For reference, I was taking this kit as an example implementation.
The text was updated successfully, but these errors were encountered:
Hello!
I'm using
ConsentState.withConsentState(user.consentState)
to create a builder to update consent inonUserIdentified
. However, when user isFilteredMParticleUser
this will crash becauseconsentState
returns null. Partial stacktrace:This should likely be caught at compile-time, since
ConsentState.withConsentState
requires a non-nullConsentState
. However, the problem is that MParticleUser.getConsentState() is annotated asNonNull
, so the Kotlin compiler trusts the annotation, while theFilteredMParticleUser
implementation returns null.For reference, I was taking this kit as an example implementation.
The text was updated successfully, but these errors were encountered: