cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject git commit: CB-5698 ios: Check to see if photoData exists before using
Date Fri, 27 Jun 2014 18:03:44 GMT
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 <skladek@nerdery.com>
Authored: Mon Feb 17 22:35:52 2014 -0600
Committer: Andrew Grieve <agrieve@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


Mime
View raw message