mirror of
https://github.com/aljazceru/Android-nRF-Toolbox.git
synced 2025-12-25 18:34:21 +01:00
Bugfix: NPE fix
RSC calls isConnected() from handler's post() which could execute after the service was destroyed.
This commit is contained in:
@@ -587,6 +587,6 @@ public abstract class BleProfileService extends Service implements BleManagerCal
|
||||
* @return <code>true</code> if device is connected to the sensor, <code>false</code> otherwise
|
||||
*/
|
||||
protected boolean isConnected() {
|
||||
return mBleManager.isConnected();
|
||||
return mBleManager != null && mBleManager.isConnected();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user