Skip to content

NullPointerException in TokenRequestTask execution #402

Description

@trebouillon

I use the version 0.7.0 of the library and sometimes get the following error:

Caused by java.lang.NullPointerException
       at java.io.Reader.<init>(Reader.java:78)
       at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
       at net.openid.appauth.Utils.readInputStream(Utils.java:36)
       at net.openid.appauth.AuthorizationService$TokenRequestTask.doInBackground(AuthorizationService.java:431)
       at net.openid.appauth.AuthorizationService$TokenRequestTask.doInBackground(AuthorizationService.java:375)
       at android.os.AsyncTask$2.call(AsyncTask.java:333)
       at java.util.concurrent.FutureTask.run(FutureTask.java:266)
       at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
       at java.lang.Thread.run(Thread.java:764)

This crash happens when the input stream is null, e.g. the server is out of business.

Would it be possible to handle a null input stream as network error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions