Adding early return for hasAcceptableContentType
This commit is contained in:
parent
cdbae5a9fb
commit
e445903901
1 changed files with 6 additions and 3 deletions
|
|
@ -173,8 +173,7 @@ static NSString * AFStringFromIndexSet(NSIndexSet *indexSet) {
|
|||
}
|
||||
|
||||
- (BOOL)hasAcceptableStatusCode {
|
||||
if(!self.response) {
|
||||
// no response means network failure or such
|
||||
if (!self.response) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
|
@ -183,6 +182,10 @@ static NSString * AFStringFromIndexSet(NSIndexSet *indexSet) {
|
|||
}
|
||||
|
||||
- (BOOL)hasAcceptableContentType {
|
||||
if (!self.response) {
|
||||
return NO;
|
||||
}
|
||||
|
||||
return ![[self class] acceptableContentTypes] || [[[self class] acceptableContentTypes] containsObject:[self.response MIMEType]];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue