Added guard around adding a NULL object to an array

This commit is contained in:
Kevin Harwood 2013-04-06 15:02:57 -05:00
parent 5b633898b3
commit c8e420990e

View file

@ -224,7 +224,8 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
SecKeyRef allowedPublicKey = SecTrustCopyPublicKey(allowedTrust); SecKeyRef allowedPublicKey = SecTrustCopyPublicKey(allowedTrust);
NSCParameterAssert(allowedPublicKey); NSCParameterAssert(allowedPublicKey);
[publicKeys addObject:(__bridge_transfer id)allowedPublicKey]; if(allowedPublicKey!=NULL)
[publicKeys addObject:(__bridge_transfer id)allowedPublicKey];
CFRelease(allowedTrust); CFRelease(allowedTrust);
CFRelease(policy); CFRelease(policy);