[Android] Fix NullPointerException in AudioModeModule
This commit is contained in:
parent
3acf0c7f64
commit
81094ba7fd
|
@ -299,7 +299,7 @@ class AudioModeModule extends ReactContextBaseJavaModule {
|
|||
* Only used on Android < M. Runs on the main thread.
|
||||
*/
|
||||
void onBluetoothDeviceChange() {
|
||||
if (bluetoothHeadsetMonitor.isHeadsetAvailable()) {
|
||||
if (bluetoothHeadsetMonitor != null && bluetoothHeadsetMonitor.isHeadsetAvailable()) {
|
||||
availableDevices.add(DEVICE_BLUETOOTH);
|
||||
} else {
|
||||
availableDevices.remove(DEVICE_BLUETOOTH);
|
||||
|
|
Loading…
Reference in New Issue