1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-28 12:56:49 +01:00

Minor changes and a fix to a NPE when mBtGatt is null

This commit is contained in:
TaaviE 2020-07-28 02:19:48 +03:00 committed by Gitea
parent 443658bf9e
commit bcac8e0d7f

View File

@ -186,8 +186,9 @@ public class CasioGB6900DeviceSupport extends AbstractBTLEDeviceSupport {
// FIXME: Replace hardcoded values by configuration
private void configureWatch(TransactionBuilder builder) {
if (mBtGatt == null)
if (mBtGatt == null) {
return;
}
byte value[] = new byte[]{GattCharacteristic.MILD_ALERT};
@ -680,10 +681,15 @@ public class CasioGB6900DeviceSupport extends AbstractBTLEDeviceSupport {
@Override
public void onFindDevice(boolean start) {
if(!isConnected())
if (!isConnected()) {
return;
}
if(start) {
if (mBtGatt == null) {
return;
}
if (start) {
try {
TransactionBuilder builder = performInitialized("findDevice");
byte value[] = new byte[]{GattCharacteristic.HIGH_ALERT};