Merge pull request #547 from jbrennan/bugfix/httpclient-nil-url-exception

-[AFHTTPClient initWithBaseURL:] will now raise an exception with a nil URL parameter.
This commit is contained in:
Mattt Thompson 2012-10-02 09:47:47 -07:00
commit b118e93986

View file

@ -237,6 +237,10 @@ static NSString * AFPropertyListStringFromParameters(NSDictionary *parameters) {
if (!self) {
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:@"/"]) {