Closed yusuf-a closed 1 year ago
Hi @yusuf-a !
Thanks for bringing this up. Another customer found this bug and we're already working in the solution (it's just what you suggest). A new version should be coming up soon with the fix. We'll keep you updated!
@diegoserranoa okay great! Thanks for the update!
@diegoserranoa I guess we can close this PR.
@vijayradke correct. We fixed this on version 0.21.1 https://github.com/Wootric/WootricSDK-iOS/blob/master/CHANGELOG.md#0211-2021-11-08
Thanks for reminding me of this!
Issue
We have had crash reports from users from the Wootric SDK, specifically from the
[WTRApiClient updateExistingEndUser:]
method with the exceptiondata parameter is nil
(see screenshot attached). On further investigation by the team we discovered that unlike other network requests inWTRApiClient
there is no check if there is anerror
before attempting to serialise the data. We believe this is why the app is crashing.Solution Following the format of other network requests in
WTRApiClient
, we check to see if there is an error before attempting to serialise the data. Iferror
is nonnull, then this error is logged. This should prevent the occurrence of thedata parameter is nil
exception.Credit to @larromba for this solution.