Alterplay / APAddressBook

Easy access to iOS address book
MIT License
1.38k stars 193 forks source link

Crash [APContact enumerateMultiValueOfProperty:fromRecord:withBlock:] #75

Closed DmitryAE closed 9 years ago

DmitryAE commented 9 years ago

Hello Alexey.

I found a bug.

Contact has no emails/phones (any arrays) but we try to retrieve it.

swift code to create contact: APContact(recordRef: person, fieldMask: .FirstName | .LastName | .Phones | .Emails) ->

[APContact enumerateMultiValueOfProperty:fromRecord:withBlock:] method ->

ABMultiValueRef multiValue = ABRecordCopyValue(recordRef, property);

multiValue is 0x0 in this case but we try to release it at CFRelease(multiValue);

So the the app crashes.

We need something like this:

if (multiValue != nil) { {
    CFRelease(multiValue);
}

Thank you for your work!

belkevich commented 9 years ago

Hi! Thank you for feedback. We'll check and fix it.

DmitryAE commented 9 years ago

Thanks! :-)

adomanico commented 9 years ago

I am also seeing this issue. Any eta on a release with a fix?

belkevich commented 9 years ago

Fixed. Checkout version 0.1.11

DmitryAE commented 9 years ago

Thanks!