[ 
https://issues.apache.org/jira/browse/CB-11206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15616013#comment-15616013
 ] 

ASF GitHub Bot commented on CB-11206:
-------------------------------------

GitHub user alsorokin opened a pull request:

    https://github.com/apache/cordova-plugin-contacts/pull/141

    CB-11206 (android) Fixed custom IM protocol parsing

    ### Platforms affected
    Android
    
    ### What does this PR do?
    Fixes an error and a possible crash when a contact have a custom IM field.
    
    ### What testing has been done on this change?
    Tested on Samsung Galaxy S3, Lenovo S850, Android 4.4 Emulator, Android 5.1 
Emulator
    
    ### Checklist
    - [x] [Reported an issue](http://cordova.apache.org/contribute/issues.html) 
in the JIRA database
    - [x] Commit message follows the format: "CB-3232: (android) Fix bug with 
resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform 
affected.
    - [ ] Added automated test coverage as appropriate for this change.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/alsorokin/cordova-plugin-contacts CB-11206

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-contacts/pull/141.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #141
    
----
commit 660b40ecc6666d986eab85892f9ba1e0696dc0ca
Author: Alexander Sorokin <alexander.soro...@akvelon.com>
Date:   2016-10-28T17:05:54Z

    CB-11206 (android) Fixed custom IM protocol parsing

----


> Contacts plugin causes app crash
> --------------------------------
>
>                 Key: CB-11206
>                 URL: https://issues.apache.org/jira/browse/CB-11206
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin Contacts
>            Reporter: Petr Odut
>
> On Samsung phone app crashes instantly with a stack trace:
> {noformat}
> java.lang.NumberFormatException
> java.lang.Integer.invalidInt(Integer.java:138)
> java.lang.Integer.parseInt(Integer.java:358)
> java.lang.Integer.parseInt(Integer.java:334)
> org.apache.cordova.contacts.ContactAccessorSdk5.imQuery(ContactAccessorSdk5.java:907)
> org.apache.cordova.contacts.ContactAccessorSdk5.populateContactArray(ContactAccessorSdk5.java:435)
> org.apache.cordova.contacts.ContactAccessorSdk5.search(ContactAccessorSdk5.java:282)
> org.apache.cordova.contacts.ContactManager$3.run(ContactManager.java:209)
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
> java.lang.Thread.run(Thread.java:818)
> {noformat}
> JS code to retrieve contacts, on Sony phone the same code works properly:
> {code:javascript}
> if(navigator.contacts) {
>       var options = new ContactFindOptions();
>       options.multiple = true;
>       options.hasPhoneNumber = true;
>       navigator.contacts.find([navigator.contacts.fieldType.phoneNumbers], 
> contacts => {
>               this.phoneContacts = contacts;
>               d.resolve(contacts);
>       }, e => d.reject(e), options);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to