mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-07-23 07:11:52 +02:00
Avoided a NullPointerException when queue is null
This commit is contained in:
parent
cbc99b49ab
commit
116b2572dd
|
@ -188,12 +188,15 @@ public class WatchXPlusDeviceSupport extends AbstractBTLEDeviceSupport {
|
||||||
*/
|
*/
|
||||||
private void cancelNotification() {
|
private void cancelNotification() {
|
||||||
try {
|
try {
|
||||||
|
if (getQueue() == null) {
|
||||||
|
LOG.warn("Unable to cancel notification, queue is null");
|
||||||
|
return;
|
||||||
|
}
|
||||||
getQueue().clear();
|
getQueue().clear();
|
||||||
TransactionBuilder builder = performInitialized("cancelNotification");
|
TransactionBuilder builder = performInitialized("cancelNotification");
|
||||||
byte[] bArr;
|
|
||||||
int mPosition = 1024; // all positions
|
int mPosition = 1024; // all positions
|
||||||
int mMessageId = 0xFF; // all messages
|
int mMessageId = 0xFF; // all messages
|
||||||
bArr = new byte[6];
|
byte[] bArr = new byte[6];
|
||||||
bArr[0] = (byte) ((int) (mPosition >> 24));
|
bArr[0] = (byte) ((int) (mPosition >> 24));
|
||||||
bArr[1] = (byte) ((int) (mPosition >> 16));
|
bArr[1] = (byte) ((int) (mPosition >> 16));
|
||||||
bArr[2] = (byte) ((int) (mPosition >> 8));
|
bArr[2] = (byte) ((int) (mPosition >> 8));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user