Closed
Description
All kind of endpoint queries have one basic bug within BAAClient.m
getPath, postPath, putPath, deletePath tries to convert empty (nil) response to NSDictionary which causes the SDK to crash immediately.
This part:
[[self.session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*)response;
NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
error:nil];
It should investigate the error return with the completionHandler prior to convert JSON to NSDictionary.
Something like this (not a full code, never tested)
[[self.session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
failure(error);
return;
}
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse*)response;
NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
error:nil];
Metadata
Metadata
Assignees
Labels
No labels