cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CB-12560) InAppWebBrowser throws NullPointerException when attempting Callback
Date Mon, 01 May 2017 23:39:04 GMT


ASF GitHub Bot commented on CB-12560:

Github user dblood commented on the issue:
    I dug through the code quite a bit and think I have found why this was so hard to reproduce
for me.  (restoring the version I had in my repo instantly caused the problem though).
    I was initially using cordova-plugin-inappbrowser 1.1.1.  
    In version 1.2.1 (specifically 4d9e4884) the 'sendUpdate(obj, false);' was moved into
a 'runOnUiThread' Runnable which ensures that they are run serially, and on the same thread.
    Although this 'fixed' the common NullPointerException when close() was called twice the
sendUpdate function still wasn't correctly guarded, only the single instance of when sendUpdate
was being called with 'false'.
    This pull request 'fixes' contextCallback references used within the same function to
ensure another thread can't modify the locally scoped reference during function execution.

> InAppWebBrowser throws NullPointerException when attempting Callback
> --------------------------------------------------------------------
>                 Key: CB-12560
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin InAppBrowser
>    Affects Versions: 6.5.0
>            Reporter: Douglas Blood
>            Priority: Minor
>              Labels: android, pull-request-available
> 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(
>     at org.apache.cordova.inappbrowser.InAppBrowser.sendUpdate(
>     at org.apache.cordova.inappbrowser.InAppBrowser.access$1100(
>     at org.apache.cordova.inappbrowser.InAppBrowser$InAppBrowserClient.onPageFinished(
>     at
>     at org.chromium.android_webview.AwContentsClientCallbackHelper$MyHandler.handleMessage(
>     at android.os.Handler.dispatchMessage(
>     at android.os.Looper.loop(
>     at
>     at java.lang.reflect.Method.invoke(Native Method)
>     at$
>     at
> Additional logs, and a patch will be coming soon.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message