alexrothenberg / motion-addressbook

MIT License
89 stars 30 forks source link

Safer, more explicit photo accessors #66

Closed rromanchuk closed 10 years ago

rromanchuk commented 10 years ago

This shouldn't be needed, as https://developer.apple.com/library/ios/documentation/AddressBook/Reference/ABPersonRef_iPhoneOS/Reference/reference.html#//apple_ref/doc/uid/TP40007210-CH3-SW12 states "The picture for person, or NULL if the person has no picture." but i'm seeing crashes here, lets just be extra explicit here anyways.

It's also probably not wise to pass back a corrupt UIImage object initWithData(nil) when there is no image available. Most callees would expect nil here, not a UIImage object when there is no photo

jmay commented 10 years ago

Thanks for paying attention to this part of the code. If you can think of how to build decent automated tests for the image stuff, that would be greatly appreciated.