From: Jacob Laursen Date: Mon, 29 Jul 2024 18:23:12 +0000 (+0200) Subject: Fix NullPointerExceptions (#17180) X-Git-Url: https://git.basschouten.com/?a=commitdiff_plain;h=e6fa6a488e92e45716940b7ba8f81518756f4986;p=openhab-addons.git Fix NullPointerExceptions (#17180) Signed-off-by: Jacob Laursen --- diff --git a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyDeviceProfile.java b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyDeviceProfile.java index 0e211e4a92..fb0ac38c19 100644 --- a/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyDeviceProfile.java +++ b/bundles/org.openhab.binding.shelly/src/main/java/org/openhab/binding/shelly/internal/api/ShellyDeviceProfile.java @@ -331,7 +331,7 @@ public class ShellyDeviceProfile { } else if (isDimmer) { if (settings.dimmers != null) { ShellySettingsDimmer dimmer = settings.dimmers.get(0); - btnType = dimmer.btnType; + btnType = getString(dimmer.btnType); } } else if (settings.relays != null) { if (numRelays == 1) { @@ -349,7 +349,7 @@ public class ShellyDeviceProfile { } } else if (isRGBW2 && (settings.lights != null) && (idx < settings.lights.size())) { ShellySettingsRgbwLight light = settings.lights.get(idx); - btnType = light.btnType; + btnType = getString(light.btnType); } return btnType.equalsIgnoreCase(SHELLY_BTNT_MOMENTARY) || btnType.equalsIgnoreCase(SHELLY_BTNT_MOM_ON_RELEASE)