Commit fbee7259 authored by testquepp's avatar testquepp Committed by GitHub
Browse files

Update RNDeviceModule.java

There might be some scenario where the developers who are using this library might not be using Bluetooth permission. so this mDevice object will be null in this case and it should be handled properly. As some will not want to add this unnecessary permission in their project.
parent c843144e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -92,7 +92,9 @@ public class RNDeviceModule extends ReactContextBaseJavaModule {

    try {
      BluetoothAdapter myDevice = BluetoothAdapter.getDefaultAdapter();
      if(mDevice!=null){
        deviceName = myDevice.getName();
      }
    } catch(Exception e) {
      e.printStackTrace();
    }