From 776346d311874b967f6331a366e5662e1a348101 Mon Sep 17 00:00:00 2001 From: Andreas Shimokawa Date: Tue, 5 Dec 2023 18:38:27 +0100 Subject: [PATCH] Xiaomi: guard against null pointer crash --- .../service/devices/xiaomi/services/XiaomiSystemService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiSystemService.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiSystemService.java index 58275705e..dd112d042 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiSystemService.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/service/devices/xiaomi/services/XiaomiSystemService.java @@ -357,6 +357,9 @@ public class XiaomiSystemService extends AbstractXiaomiService implements Xiaomi inMoreSection = true; continue; } + if (labelsMap.get(enabledScreen) == null) { + continue; + } final XiaomiProto.DisplayItem.Builder displayItem = XiaomiProto.DisplayItem.newBuilder() .setCode(enabledScreen)