From c8e420990efc80a1eba059f9c34fab0023efdcfc Mon Sep 17 00:00:00 2001 From: Kevin Harwood Date: Sat, 6 Apr 2013 15:02:57 -0500 Subject: [PATCH] Added guard around adding a NULL object to an array --- AFNetworking/AFURLConnectionOperation.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AFNetworking/AFURLConnectionOperation.m b/AFNetworking/AFURLConnectionOperation.m index f7dd75c..7ddc96b 100644 --- a/AFNetworking/AFURLConnectionOperation.m +++ b/AFNetworking/AFURLConnectionOperation.m @@ -224,7 +224,8 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat SecKeyRef allowedPublicKey = SecTrustCopyPublicKey(allowedTrust); NSCParameterAssert(allowedPublicKey); - [publicKeys addObject:(__bridge_transfer id)allowedPublicKey]; + if(allowedPublicKey!=NULL) + [publicKeys addObject:(__bridge_transfer id)allowedPublicKey]; CFRelease(allowedTrust); CFRelease(policy);