Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11880

cordova/exec crashes on Android when no [<args>] supplied

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Implemented
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: cordova-android
    • Labels:
      None

      Description

      When calling the function

      cordova.exec(<successFunction>, <failFunction>, <service>, <action>, [<args>])

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                Fluf Thomas Raffray
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: