Repository: cordova-plugin-contacts Updated Branches: refs/heads/master e502df5d9 -> cfa51f9ec
CB-5698 ios: Check to see if photoData exists before using close #19 Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/commit/f5908a4f Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/tree/f5908a4f Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/diff/f5908a4f Branch: refs/heads/master Commit: f5908a4fcf8c819dafa9e0d605471c80ad61514f Parents: 9075e13 Author: Sean Kladek <[email protected]> Authored: Mon Feb 17 22:35:52 2014 -0600 Committer: Ian Clelland <[email protected]> Committed: Fri Jun 27 14:32:41 2014 -0400 ---------------------------------------------------------------------- src/ios/CDVContact.m | 4 ++++ 1 file changed, 4 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/blob/f5908a4f/src/ios/CDVContact.m ---------------------------------------------------------------------- diff --git a/src/ios/CDVContact.m b/src/ios/CDVContact.m index 5bf9f3c..90310e1 100644 --- a/src/ios/CDVContact.m +++ b/src/ios/CDVContact.m @@ -1326,6 +1326,10 @@ static NSDictionary* org_apache_cordova_contacts_defaultFields = nil; if (ABPersonHasImageData(self.record)) { CFDataRef photoData = ABPersonCopyImageData(self.record); + if (!photoData) { + return; + } + NSData* data = (__bridge NSData*)photoData; // write to temp directory and store URI in photos array // get the temp directory path
