cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-11880) cordova/exec crashes on Android when no [<args>] supplied
Date Wed, 21 Sep 2016 09:16:20 GMT

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

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

GitHub user Fluf22 opened a pull request:

    https://github.com/apache/cordova-android/pull/334

    CB-11880 android: Fail-safe for cordova.exec()

    - added preliminary sanity check on args variable
    - replication of iosExec() behaviour
    - allows to call cordova.exec() without args variable

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

    $ git pull https://github.com/Fluf22/cordova-android CB-11880

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

    https://github.com/apache/cordova-android/pull/334.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 #334
    
----

----


> cordova/exec crashes on Android when no [<args>] supplied
> ---------------------------------------------------------
>
>                 Key: CB-11880
>                 URL: https://issues.apache.org/jira/browse/CB-11880
>             Project: Apache Cordova
>          Issue Type: Improvement
>          Components: Android
>            Reporter: Thomas Raffray
>            Priority: Minor
>
> When calling the function {code}cordova.exec(<successFunction>, <failFunction>,
<service>, <action>, [<args>]){code} without the last argument, a TypeError
is returned.
> The issue happens after cordova-android/cordova-js-src/exec.js tries to call the length()
function on args. As a result, the Cordova platform does not invoke the native plugin code.
> Although the exec() prototype clearly requires the \[<args>\] parameter, the iOS
version of exec() makes a preliminary sanity check on this variable to avoid generating an
error.
> Suggest to replicate this behaviour on the Android platform to provide the same fail-safe
mechanism.



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

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


Mime
View raw message