mParticle / mparticle-apple-sdk

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

fix: Type hinting MPIdentityApiRequest.identities #270

Closed einsteinx2 closed 4 months ago

einsteinx2 commented 4 months ago

Summary

Fix crash when accessing the -[MPIdentityApiRequest identity] property from Swift due to incorrect type hinting

We had it hinted as <NSNumber*, NSString*> but then we also stored NSNull objects in some cases. That was fine with Objective-C since it ignores the type hints at runtime, but Swift doesn't and crashes if any NSNull objects are present when accessing the identities property.

Note this doesn't actually change the underlying behavior of this property in any way, it just now is correctly type hinted as <NSNumber*, NSObject*> to include the possibility of NSNull.

Testing Plan

mparticle-automation commented 4 months ago

:tada: This PR is included in version 8.21.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: