Return-Path: X-Original-To: apmail-cordova-issues-archive@minotaur.apache.org Delivered-To: apmail-cordova-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B6BC91017F for ; Wed, 5 Feb 2014 23:42:10 +0000 (UTC) Received: (qmail 38780 invoked by uid 500); 5 Feb 2014 23:42:10 -0000 Delivered-To: apmail-cordova-issues-archive@cordova.apache.org Received: (qmail 38753 invoked by uid 500); 5 Feb 2014 23:42:09 -0000 Mailing-List: contact issues-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list issues@cordova.apache.org Received: (qmail 38744 invoked by uid 99); 5 Feb 2014 23:42:09 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Feb 2014 23:42:09 +0000 Date: Wed, 5 Feb 2014 23:42:09 +0000 (UTC) From: "Abe S (JIRA)" To: issues@cordova.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CB-5769) Contact Find crashes if contact has no name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CB-5769?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Abe S updated CB-5769: ---------------------- Affects Version/s: 3.3.0 > Contact Find crashes if contact has no name > ------------------------------------------- > > Key: CB-5769 > URL: https://issues.apache.org/jira/browse/CB-5769 > Project: Apache Cordova > Issue Type: Bug > Components: Android, Plugin Contacts > Affects Versions: 3.0.0, 3.3.0 > Environment: Nexus 4, android 4.4, phonegap build > Reporter: Abe S > > There seems to be a bug in the contacts finder, it crashes when a contact has no name, and name is one of the selected fields. > Here is what my function call looks like: > {code} > navigator.contacts.find( ["name", "phoneNumbers"], > function (contacts) { > // DO STUFF HERE > }, > function (contactError) { > alert('There was an error loading contacts, please try again.'); > }, > { > filter: "", > multiple: true, > } > ); > {code} > And when there is one contact on the device with no name it crashes with this stacktrace: > {noformat} > processMessage failed: Error: TypeError: Cannot read property 'formatted' of null > processMessage failed: Stack: TypeError: Cannot read property 'formatted' of null > at Object.eval (eval at (http://debug.build.phonegap.com/target/target-script-min.js:2340:26), :18:65) > at Function.b.extend.each (file:///android_asset/www/js/jquery-1.9.1.min.js:3:5257) > at navigator.contacts.find.filter (eval at (http://debug.build.phonegap.com/target/target-script-min.js:2340:26), :15:12) > at Function.b.extend.each (file:///android_asset/www/js/jquery-1.9.1.min.js:3:5257) > at navigator.contacts.find.filter (eval at (http://debug.build.phonegap.com/target/target-script-min.js:2340:26), :12:9) > at win (file:///android_asset/www/plugins/org.apache.cordova.contacts/www/contacts.js:51:17) > at Object.cordova.callbackFromNative (file:///android_asset/www/cordova.js:307:54) > at processMessage (file:///android_asset/www/cordova.js:1029:21) > at Function.androidExec.processMessages (file:///android_asset/www/cordova.js:1063:13) > at pollOnce (file:///android_asset/www/cordova.js:933:17) > {noformat} > Of course, when I add a name to that contact, it no longer crashes. > This is experienced on phonegpa 3.0, on phonegap build, so it might be already fixed in later versions of phonegap, but that could easily be tested by anyone using those later versions. -- This message was sent by Atlassian JIRA (v6.1.5#6160)