You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/06/27 20:03:44 UTC

git commit: CB-5698 ios: Check to see if photoData exists before using

Repository: cordova-plugin-contacts
Updated Branches:
  refs/heads/master c3d8987e7 -> 1b012391a


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/1b012391
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/tree/1b012391
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/diff/1b012391

Branch: refs/heads/master
Commit: 1b012391aca60220027dd2d560c157b703395be4
Parents: c3d8987
Author: Sean Kladek <sk...@nerdery.com>
Authored: Mon Feb 17 22:35:52 2014 -0600
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Jun 27 14:03:32 2014 -0400

----------------------------------------------------------------------
 src/ios/CDVContact.m | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/blob/1b012391/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