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

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

GitHub user dblood opened a pull request:

    https://github.com/apache/cordova-plugin-inappbrowser/pull/215

    CB-12560: (android) fix null pointer with callback when loading multi…

    ### Platforms affected
    Android
    
    ### What does this PR do?
    When multiple urls are requested sequentially (such as a monitor script), 
the object reference to callback could be nulled by another thread causing a 
NullPointerException.
    
    ### What testing has been done on this change?
    I have run the automated tests, and successfully ran the application 
without the crash.
    
    ### 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.
    - [X] 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/dblood/cordova-plugin-inappbrowser CB-12560

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

    https://github.com/apache/cordova-plugin-inappbrowser/pull/215.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 #215
    
----
commit fc08376ee1bcced9fd37912c7559a9abe0dc520f
Author: Douglas Blood <[email protected]>
Date:   2017-03-10T00:30:08Z

    CB-12560: (android) fix null pointer with callback when loading multiple 
urls

----


> InAppWebBrowser throws NullPointerException when attempting Callback
> --------------------------------------------------------------------
>
>                 Key: CB-12560
>                 URL: https://issues.apache.org/jira/browse/CB-12560
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 6.5.0
>            Reporter: Douglas Blood
>            Priority: Minor
>              Labels: android
>
> Using oidc-client.js and a redirection url of "http://localhost/";.  After 
> login the "monitor" will attempt a request every second using the 
> InAppBrowser instance that was logged in with.
> Occasionally, this will result in the following null pointer exception.
> java.lang.NullPointerException: Attempt to invoke virtual method 'void 
> org.apache.cordova.CallbackContext.sendPluginResult(org.apache.cordova.PluginResult)'
>  on a null object reference
>     at 
> org.apache.cordova.inappbrowser.InAppBrowser.sendUpdate(InAppBrowser.java:733)
>     at 
> org.apache.cordova.inappbrowser.InAppBrowser.sendUpdate(InAppBrowser.java:720)
>     at 
> org.apache.cordova.inappbrowser.InAppBrowser.access$1100(InAppBrowser.java:72)
>     at 
> org.apache.cordova.inappbrowser.InAppBrowser$InAppBrowserClient.onPageFinished(InAppBrowser.java:849)
>     at 
> com.android.webview.chromium.WebViewContentsClientAdapter.onPageFinished(WebViewContentsClientAdapter.java:531)
>     at 
> org.chromium.android_webview.AwContentsClientCallbackHelper$MyHandler.handleMessage(AwContentsClientCallbackHelper.java:188)
>     at android.os.Handler.dispatchMessage(Handler.java:102)
>     at android.os.Looper.loop(Looper.java:154)
>     at android.app.ActivityThread.main(ActivityThread.java:6119)
>     at java.lang.reflect.Method.invoke(Native Method)
>     at 
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
>     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
> Additional logs, and a patch will be coming soon.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to