You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2014/01/24 01:35:46 UTC

git commit: CB-4590 - chooseContact in CDVContacts crashes app

Updated Branches:
  refs/heads/dev 975913cd7 -> 8e89957cc


CB-4590 - chooseContact in CDVContacts crashes app


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

Branch: refs/heads/dev
Commit: 8e89957ccc8b4a29229d4335c39a1ccf961d2498
Parents: 975913c
Author: Shazron Abdullah <sh...@apache.org>
Authored: Thu Jan 23 16:35:38 2014 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Thu Jan 23 16:35:38 2014 -0800

----------------------------------------------------------------------
 src/ios/CDVContacts.m | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-contacts/blob/8e89957c/src/ios/CDVContacts.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVContacts.m b/src/ios/CDVContacts.m
index 7ca6c80..aa0c9c7 100644
--- a/src/ios/CDVContacts.m
+++ b/src/ios/CDVContacts.m
@@ -195,7 +195,12 @@
     pickerController.callbackId = callbackId;
     pickerController.options = options;
     pickerController.pickedContactDictionary = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithInt:kABRecordInvalidID], kW3ContactId, nil];
-    pickerController.allowsEditing = (BOOL)[options existsValue : @"true" forKey : @"allowsEditing"];
+    id allowsEditingValue = [options valueForKey:@"allowsEditing"];
+    BOOL allowsEditing = NO;
+    if ([allowsEditingValue isKindOfClass:[NSNumber class]]) {
+        allowsEditing = [(NSNumber*)allowsEditingValue boolValue];
+    }
+    pickerController.allowsEditing = allowsEditing;
 
     SEL selector = NSSelectorFromString(@"presentViewController:animated:completion:");
     if ([self.viewController respondsToSelector:selector]) {