Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix library behaviour on environments where BluetoothAdapter is unavailable #158

Closed
StanislavChumarin opened this issue Apr 3, 2017 · 1 comment
Assignees
Labels
bug Bug that is caused by the library

Comments

@StanislavChumarin
Copy link

StanislavChumarin commented Apr 3, 2017

Application crashes on emulator


Steps to reproduce actual result

  1. Just try to run RxBleClient.create(context) on emulator or device without bluetooth

Actual result

java.lang.NullPointerException: Cannot return null from a non-@Nullable @Provides method
                                                                 at dagger.internal.Preconditions.checkNotNull(Preconditions.java:48)
                                                                 at com.polidea.rxandroidble.ClientComponent_ClientModule_ProvideBlutetoothAdapterFactory.get(ClientComponent_ClientModule_ProvideBlutetoothAdapterFactory.java:20)
                                                                 at com.polidea.rxandroidble.ClientComponent_ClientModule_ProvideBlutetoothAdapterFactory.get(ClientComponent_ClientModule_ProvideBlutetoothAdapterFactory.java:8)
                                                                 at com.polidea.rxandroidble.internal.util.RxBleAdapterWrapper_Factory.get(RxBleAdapterWrapper_Factory.java:18)
                                                                 at com.polidea.rxandroidble.internal.util.RxBleAdapterWrapper_Factory.get(RxBleAdapterWrapper_Factory.java:8)
                                                                 at com.polidea.rxandroidble.RxBleClientImpl_Factory.get(RxBleClientImpl_Factory.java:67)
                                                                 at com.polidea.rxandroidble.RxBleClientImpl_Factory.get(RxBleClientImpl_Factory.java:16)
                                                                 at com.polidea.rxandroidble.ClientComponent_ClientModule_ProvideRxBleClientFactory.get(ClientComponent_ClientModule_ProvideRxBleClientFactory.java:25)
                                                                 at com.polidea.rxandroidble.ClientComponent_ClientModule_ProvideRxBleClientFactory.get(ClientComponent_ClientModule_ProvideRxBleClientFactory.java:8)
                                                                 at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
                                                                 at com.polidea.rxandroidble.DaggerClientComponent.rxBleClient(DaggerClientComponent.java:271)
                                                                 at com.polidea.rxandroidble.RxBleClient.create(RxBleClient.java:27)

#### Expected result Just return NULL or empty stub implementation
@dariuszseweryn dariuszseweryn added the bug Bug that is caused by the library label Apr 3, 2017
@dariuszseweryn dariuszseweryn changed the title Crash on emulator Fix library behaviour on environments where BluetoothAdapter is unavailable Apr 3, 2017
@dariuszseweryn dariuszseweryn self-assigned this Apr 4, 2017
dariuszseweryn added a commit that referenced this issue Apr 5, 2017
Reviewers: michal.zielinski, pawel.urban

Reviewed By: pawel.urban

Differential Revision: https://phabricator.polidea.com/D2283
@dariuszseweryn
Copy link
Owner

Hello @StanislavChumarin
This issue should be fixed in the 1.3.0-SNAPSHOT release.
Best Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that is caused by the library
Projects
None yet
Development

No branches or pull requests

2 participants