When I call BluetoothSerial.connect inside setInterval() my app crashes.
E/AndroidRuntime: FATAL EXCEPTION: ConnectThread
java.lang.NullPointerException: Attempt to invoke interface method 'void com.facebook.react.bridge.Callback.invoke(java.lang.Object[])' on a null object reference
at com.facebook.react.bridge.PromiseImpl.reject(PromiseImpl.java:231)
at com.facebook.react.bridge.PromiseImpl.reject(PromiseImpl.java:104)
at com.rusel.RCTBluetoothSerial.RCTBluetoothSerialModule.onConnectionFailed(RCTBluetoothSerialModule.java:449)
at com.rusel.RCTBluetoothSerial.RCTBluetoothSerialService.connectionFailed(RCTBluetoothSerialService.java:157)
at com.rusel.RCTBluetoothSerial.RCTBluetoothSerialService.access$300(RCTBluetoothSerialService.java:23)
at com.rusel.RCTBluetoothSerial.RCTBluetoothSerialService$ConnectThread.run(RCTBluetoothSerialService.java:245)
When I call BluetoothSerial.connect inside setInterval() my app crashes.