1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-07-03 11:33:19 +02:00

Avoided a NullPointerException when queue is null

This commit is contained in:
TaaviE 2020-08-30 18:05:01 +03:00 committed by Gitea
parent cbc99b49ab
commit 116b2572dd

View File

@ -188,12 +188,15 @@ public class WatchXPlusDeviceSupport extends AbstractBTLEDeviceSupport {
*/
private void cancelNotification() {
try {
if (getQueue() == null) {
LOG.warn("Unable to cancel notification, queue is null");
return;
}
getQueue().clear();
TransactionBuilder builder = performInitialized("cancelNotification");
byte[] bArr;
int mPosition = 1024; // all positions
int mMessageId = 0xFF; // all messages
bArr = new byte[6];
byte[] bArr = new byte[6];
bArr[0] = (byte) ((int) (mPosition >> 24));
bArr[1] = (byte) ((int) (mPosition >> 16));
bArr[2] = (byte) ((int) (mPosition >> 8));