vanniktech / RxPermission

Reactive permissions for Android
http://vanniktech.com
Apache License 2.0
199 stars 27 forks source link

Crash report: NullPointerException: Attempt to read from null array #129

Closed trietbui85 closed 1 year ago

trietbui85 commented 1 year ago

I receive this crash (from Crashlytics)

Fatal Exception: java.lang.RuntimeException: 
Failure delivering result ResultInfo{who=@android:requestPermissions:, request=42, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} 
to activity {com.zalora.android/com.vanniktech.rxpermission.ShadowActivity}: 
java.lang.NullPointerException: Attempt to read from null array
       at android.app.ActivityThread.deliverResults(ActivityThread.java:6007)
       at android.app.ActivityThread.handleSendResult(ActivityThread.java:6046)
       at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67)
       at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2571)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:226)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8741)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Cause:

Caused by java.lang.NullPointerException: Attempt to read from null array
       at com.vanniktech.rxpermission.RealRxPermission.onRequestPermissionsResult(RealRxPermission.java:204)
       at com.vanniktech.rxpermission.ShadowActivity.onRequestPermissionsResult(ShadowActivity.java:53)
       at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:9111)
       at android.app.Activity.dispatchActivityResult(Activity.java:8942)
       at android.app.ActivityThread.deliverResults(ActivityThread.java:6000)
       at android.app.ActivityThread.handleSendResult(ActivityThread.java:6046)
       at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:67)
       at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
       at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
       at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2571)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loopOnce(Looper.java:226)
       at android.os.Looper.loop(Looper.java:313)
       at android.app.ActivityThread.main(ActivityThread.java:8741)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Version: com.vanniktech:rxpermission:0.10.0

Do you have any idea?

vanniktech commented 1 year ago

Nope but NPE can be fixed easily

vanniktech commented 1 year ago

I'm closing this issue due to inactivity. If you have any further input on the issue, don't hesitate to reopen this issue or post a new one.