lizhuext / google-toolbox-for-mac

Automatically exported from code.google.com/p/google-toolbox-for-mac
Apache License 2.0
0 stars 0 forks source link

Unit test crash if access to address book is not granted #90

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Repro steps:

1. Checkout
2. Open project
3. Run unit tests
4. When prompted, do not allow "otest" to access address book
5. Crash on GTMABAddressBook.m:84

ABGetSharedAddressBook() returns nil if access is not granted. Trying to retain 
nil will cause a crash (I'm using OS X 10.8). I have attached a patch that 
checks for nil before attempting to retain. This avoids the crash, though the 
unit tests will obviously fail.

Original issue reported on code.google.com by dlre...@gmail.com on 19 Feb 2013 at 8:43

Attachments: