mParticle / mparticle-apple-sdk

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

Crash due to NSNull being cast to NSString #250

Open via-guy opened 8 months ago

via-guy commented 8 months ago

We have a crash in Leanplum-iOS-SDK caused by https://github.com/mParticle/mparticle-apple-sdk/blob/main/mParticle-Apple-SDK/Identity/MPIdentityApiRequest.m#L30. We get to https://github.com/Leanplum/Leanplum-iOS-SDK/blob/master/LeanplumSDK/LeanplumSDK/Classes/Internal/Leanplum.m#L2004 and the app crashes because it's expecting an NSString but is trying to call function [NSNull length].

Why do you perform this cast? Can't we just leave the value as nil instead of NSNull?