sumup / sumup-android-sdk

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

Crash when Bluetooth is missing #42

Closed vladaman closed 6 years ago

vladaman commented 6 years ago

When I submit a payment via intent and Bluetooth is not present on the device I get crash. Well, it's not really important, since without Bluetooth SumUp cannot be used but at least this should be handled.

03-26 18:03:20.664  8287  8287 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp/com.sumup.merchant.ui.Activities.CheckoutAPIDrivenPageActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.bluetooth.BluetoothAdapter.isEnabled()' on a null object reference
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at android.app.ActivityThread.-wrap12(ActivityThread.java)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:102)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:154)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6077)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
03-26 18:03:20.664  8287  8287 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.bluetooth.BluetoothAdapter.isEnabled()' on a null object reference
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at com.sumup.merchant.cardreader.ReaderLibManager.wakePinPlusDevice(SourceFile:344)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at com.sumup.merchant.cardreader.ReaderLibManager.cleanAndWakePinPlusDevice(SourceFile:329)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at com.sumup.merchant.ui.Activities.CheckoutAPIDrivenPageActivity.onSafeCreate(SourceFile:118)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at com.sumup.merchant.ui.Activities.SumUpBaseActivity.onCreate(SourceFile:47)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at com.sumup.merchant.ui.Activities.CheckoutAPIDrivenPageActivity.onCreate(SourceFile:102)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at android.app.Activity.performCreate(Activity.java:6662)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
03-26 18:03:20.664  8287  8287 E AndroidRuntime:    ... 9 more
vfoixcable commented 6 years ago

Hi, thanks for you re feedback. It will be handled internally