Clancey / simple_auth

The Simplest way to Authenticate in Flutter
MIT License
352 stars 108 forks source link

NPE when cancelling login #94

Open ened opened 5 years ago

ened commented 5 years ago
E/AndroidRuntime(22421): java.lang.RuntimeException: Unable to resume activity {com.company.app/com.company.app.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.EventChannel$EventSink.success(java.lang.Object)' on a null object reference
E/AndroidRuntime(22421):    at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3822)
E/AndroidRuntime(22421):    at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3854)
E/AndroidRuntime(22421):    at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:51)
E/AndroidRuntime(22421):    at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145)
E/AndroidRuntime(22421):    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
E/AndroidRuntime(22421):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
E/AndroidRuntime(22421):    at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(22421):    at android.os.Looper.loop(Looper.java:193)
E/AndroidRuntime(22421):    at android.app.ActivityThread.main(ActivityThread.java:6718)
E/AndroidRuntime(22421):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(22421):    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/AndroidRuntime(22421):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
E/AndroidRuntime(22421): Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.EventChannel$EventSink.success(java.lang.Object)' on a null object reference
E/AndroidRuntime(22421):    at clancey.simpleauth.simpleauthflutter.WebAuthenticator.cancel(WebAuthenticator.java:62)
E/AndroidRuntime(22421):    at clancey.simpleauth.simpleauthflutter.CustomTabsAuthenticator.onResume(CustomTabsAuthenticator.java:74)
E/AndroidRuntime(22421):    at clancey.simpleauth.simpleauthflutter.ActivityLifecycleCallbackManager.onActivityResumed(ActivityLifecycleCallbackManager.java:30)
E/AndroidRuntime(22421):    at android.app.Application.dispatchActivityResumed(Application.java:239)
E/AndroidRuntime(22421):    at android.app.Activity.onResume(Activity.java:1343)
E/AndroidRuntime(22421):    at io.flutter.app.FlutterActivity.onResume(FlutterActivity.java:100)
E/AndroidRuntime(22421):    at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1412)

Using simple_auth_flutter 2.0.4.