sumup / sumup-android-sdk

Sample App for the SumUp Android SDK
Other
107 stars 28 forks source link

RuntimeException on android.bluetooth.adapter.action.STATE_CHANGED #210

Open towsif-hossain opened 1 year ago

towsif-hossain commented 1 year ago

Crash is quite frequently registered on Crashlytics for Android 13 Samsung device mostly

`Fatal Exception: java.lang.RuntimeException: Error receiving broadcast Intent { act=android.bluetooth.adapter.action.STATE_CHANGED flg=0x4000010 (has extras) } in com.sumup.merchant.reader.helpers.BluetoothStateChangeHelper$1@c2e477a
   at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$android-app-LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1928)
   at android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0.run(:2)
   at android.os.Handler.handleCallback(Handler.java:942)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loopOnce(Looper.java:226)
   at android.os.Looper.loop(Looper.java:313)
   at android.app.ActivityThread.main(ActivityThread.java:8757)
   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)`

   `Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
   at com.sumup.merchant.reader.troubleshooting.ui.PinPlusBtToggleFragment.handleRightButtonClick(SourceFile:1)
   at com.sumup.merchant.reader.troubleshooting.ui.PinPlusBtToggleFragment$1$1.onComplete(SourceFile:2)
   at com.sumup.merchant.reader.helpers.BluetoothStateChangeHelper$1.onReceive(SourceFile:24)
   at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$android-app-LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1907)
   at android.app.LoadedApk$ReceiverDispatcher$Args$$ExternalSyntheticLambda0.run(:2)
   at android.os.Handler.handleCallback(Handler.java:942)
   at android.os.Handler.dispatchMessage(Handler.java:99)
   at android.os.Looper.loopOnce(Looper.java:240)
   at android.os.Looper.loop(Looper.java:351)
   at android.app.ActivityThread.main(ActivityThread.java:8380)
   at java.lang.reflect.Method.invoke(Method.java)
   at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013)`