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

jcesarmobile commented on CB-12184:
-----------------------------------

Just for your information, executeScript doesn't work when you use _system 
param as _system opens the browser and you can't inject code into it.

But it's worth fixing the problem to not make the app crash.


> 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
>
> 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]

Reply via email to