Skip to content

Commit c8e4209

Browse files
committed
Added guard around adding a NULL object to an array
1 parent 5b63389 commit c8e4209

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

AFNetworking/AFURLConnectionOperation.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,8 @@ + (NSArray *)pinnedPublicKeys {
224224

225225
SecKeyRef allowedPublicKey = SecTrustCopyPublicKey(allowedTrust);
226226
NSCParameterAssert(allowedPublicKey);
227-
[publicKeys addObject:(__bridge_transfer id)allowedPublicKey];
227+
if(allowedPublicKey!=NULL)
228+
[publicKeys addObject:(__bridge_transfer id)allowedPublicKey];
228229

229230
CFRelease(allowedTrust);
230231
CFRelease(policy);

0 commit comments

Comments
 (0)