[
https://issues.apache.org/jira/browse/CB-12184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15693909#comment-15693909
]
ASF GitHub Bot commented on CB-12184:
-------------------------------------
GitHub user jcesarmobile opened a pull request:
https://github.com/apache/cordova-plugin-inappbrowser/pull/199
CB-12184 executeScript leads to a null pointer on exception on Android.
### Platforms affected
Android
### What does this PR do?
Avoid null pointer exception when executeScript is used with _system target
Also documented better that you can't use executeScript with _system target
### What testing has been done on this change?
### 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/jcesarmobile/cordova-plugin-inappbrowser
CB-12184
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/cordova-plugin-inappbrowser/pull/199.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 #199
----
commit 93c056efd86a5faed7ff08d4456b6ba68db3174f
Author: Julio César <[email protected]>
Date: 2016-11-24T17:50:49Z
CB-12184 executeScript leads to a null pointer on exception on Android.
----
> executeScript leads to a null pointer on exception on Android.
> --------------------------------------------------------------
>
> Key: CB-12184
> URL: https://issues.apache.org/jira/browse/CB-12184
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin InAppBrowser
> Environment: Android 6.0 / OnePlus One / Ionic2 (rc2)
> Reporter: Mathieu N
> Assignee: jcesarmobile
>
> Hi,
> I am using the following typescript code:
> {code:javascript}
> let browser = new InAppBrowser('https://some_url', '_system');
> let script:string = "someJs";
>
> browser.executeScript({code: script});
> {code}
> Upon execution, it yields the following stacktrace:
> {panel}
> java.lang.NullPointerException: Attempt to invoke virtual method 'void
> android.webkit.WebView.evaluateJavascript(java.lang.String,
> android.webkit.ValueCallback)' on a null object reference
> at
> org.apache.cordova.inappbrowser.InAppBrowser$3.run(InAppBrowser.java:333)
> at android.os.Handler.handleCallback(Handler.java:739)
> at android.os.Handler.dispatchMessage(Handler.java:95)
> at android.os.Looper.loop(Looper.java:148)
> at android.app.ActivityThread.main(ActivityThread.java:5461)
> at java.lang.reflect.Method.invoke(Native Method)
> at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
> at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
> {panel}
> M.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]