I am working on a project that uses this sdk, and I found a crash using a limited or very bad internet connection.
When that request reaches a timeout or the server responds an error, the data is nil, and, as there is no validation, the app crashes.
In order to avoid the crash, I added a simple validation of the callback parameters, and changed the way to create that request, because of the deprecation of [NSURLConnection sendAsynchronousRequest:queue:completionHandler:]method in iOS 9.
In addition, I added a single test of the modified method to ensure that everything looks good.
Minor changes were added in order to compile the project (due to recommendations of the IDE) and to run the test.
I removed the previous PR and created this one to be more organized and clear. I saw and tried to follow all of your feedback.
Hi,
I am working on a project that uses this sdk, and I found a crash using a limited or very bad internet connection.
When that request reaches a timeout or the server responds an error, the data is nil, and, as there is no validation, the app crashes.
In order to avoid the crash, I added a simple validation of the callback parameters, and changed the way to create that request, because of the deprecation of
[NSURLConnection sendAsynchronousRequest:queue:completionHandler:]
method in iOS 9.In addition, I added a single test of the modified method to ensure that everything looks good.
Minor changes were added in order to compile the project (due to recommendations of the IDE) and to run the test.
I removed the previous PR and created this one to be more organized and clear. I saw and tried to follow all of your feedback.