mParticle / mparticle-apple-sdk

mParticle Apple SDK
Apache License 2.0
46 stars 66 forks source link

App Crash when accessing MPIdentityApiRequest.identities #268

Closed KristofferHermansen closed 6 months ago

KristofferHermansen commented 6 months ago

Explanation

It seems that the update 8.18.0 changed something regarding to MPIdentityApiRequest.identities.

Right now the property MPIdentityApiRequest.email is defined as nullable, but if the identities property is accessed while the email is set to null, the app results in a crash with the following message: "Could not cast value of type 'NSNull' to 'NSString'."

Steps to reproduce

let identityRequest = MPIdentityApiRequest.withEmptyUser()
identityRequest.email = nil
print(identityRequest.identities)
KristofferHermansen commented 6 months ago

Might be the same issue as described in #250

KristofferHermansen commented 6 months ago

Fixed in #270