-initWithBaseURL: will now raise an exception with a nil URL parameter. This enforces what the code comments say.
Without this, Reachability might cause the application to crash on iOS 6 if the baseURL is nil.
This commit is contained in:
parent
25136ddfbe
commit
284f57d39f
1 changed files with 4 additions and 0 deletions
|
|
@ -238,6 +238,10 @@ static NSString * AFPropertyListStringFromParameters(NSDictionary *parameters) {
|
|||
return nil;
|
||||
}
|
||||
|
||||
if (!url) {
|
||||
[NSException raise:@"-[AFHTTPClient initWithBaseURL:] nil URL" format:@"`url` must not be nil"];
|
||||
}
|
||||
|
||||
// Ensure terminal slash for baseURL path, so that NSURL +URLWithString:relativeToURL: works as expected
|
||||
if ([[url path] length] > 0 && ![[url absoluteString] hasSuffix:@"/"]) {
|
||||
url = [url URLByAppendingPathComponent:@""];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue