Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

UncaughtException detected: java.lang.NullPointerException #107

Open
W-quan opened this issue Jun 11, 2019 · 1 comment
Open

UncaughtException detected: java.lang.NullPointerException #107

W-quan opened this issue Jun 11, 2019 · 1 comment

Comments

@W-quan
Copy link

W-quan commented Jun 11, 2019

-06-11 17:33:55.317 10370-10370/com.live18.app E/CrashHandler: In thread: Thread[main,5,main]
    UncaughtException detected: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.Date com.google.auth.oauth2.AccessToken.getExpirationTime()' on a null object reference
        at com.yiwuzhibo.live.service.SpeechService$AccessTokenTask.onPostExecute(SpeechService.java:390)
        at com.yiwuzhibo.live.service.SpeechService$AccessTokenTask.onPostExecute(SpeechService.java:337)
        at android.os.AsyncTask.finish(AsyncTask.java:695)
        at android.os.AsyncTask.-wrap1(Unknown Source:0)
        at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
        at android.os.Handler.dispatchMessage(Handler.java:105)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6938)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
@W-quan
Copy link
Author

W-quan commented Jun 11, 2019

            // Schedule access token refresh before it expires
            if (mHandler != null) {
                mHandler.postDelayed(mFetchAccessTokenRunnable,
                        Math.max(accessToken.getExpirationTime().getTime()
                                - System.currentTimeMillis()
                                - ACCESS_TOKEN_FETCH_MARGIN, ACCESS_TOKEN_EXPIRATION_TOLERANCE));
            }

I'm confused for Math.max(). Why not Math.min()?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant