From c0558c570ccd32cbede8dce419540a0e5e907b64 Mon Sep 17 00:00:00 2001 From: Zhong Jianxin Date: Wed, 20 May 2020 11:05:00 +0800 Subject: [PATCH] Huami: Check if musicSpec/stateSpec is null --- .../gadgetbridge/service/devices/huami/HuamiSupport.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiSupport.java index 810d36c5d..519ca87eb 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/huami/HuamiSupport.java @@ -805,7 +805,7 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport { return; } - if (!stateSpec.equals(bufferMusicStateSpec)) { + if (stateSpec != null && !stateSpec.equals(bufferMusicStateSpec)) { bufferMusicStateSpec = stateSpec; sendMusicStateToDevice(); } @@ -819,7 +819,7 @@ public class HuamiSupport extends AbstractBTLEDeviceSupport { return; } - if (!musicSpec.equals(bufferMusicSpec)) { + if (musicSpec != null && !musicSpec.equals(bufferMusicSpec)) { bufferMusicSpec = musicSpec; if (isMusicAppStarted) { sendMusicStateToDevice();