Skip to content

Commit

Permalink
Fix NullPointerException (openhab#14010)
Browse files Browse the repository at this point in the history
Fixes openhab#13961

Signed-off-by: Jacob Laursen <[email protected]>
Signed-off-by: Andras Uhrin <[email protected]>
  • Loading branch information
jlaur authored and andrasU committed Jan 5, 2024
1 parent 51461b2 commit 5c23fae
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,10 @@ public static Map<String, Channel> createRelayChannels(final Thing thing, final
}

// Shelly 1/1PM and Plus 1/1PM Addon
addChannel(thing, add,
profile.settings.extSwitch != null && profile.settings.extSwitch.input0 != null
&& idx == getInteger(profile.settings.extSwitch.input0.relayNum),
CHGR_SENSOR, CHANNEL_ESENSOR_INPUT + (profile.settings.extSwitch.input0.relayNum + 1));
if (profile.settings.extSwitch != null && profile.settings.extSwitch.input0 != null
&& idx == getInteger(profile.settings.extSwitch.input0.relayNum)) {
addChannel(thing, add, true, CHGR_SENSOR, CHANNEL_ESENSOR_INPUT + (idx + 1));
}
if (profile.status.extTemperature != null) {
addChannel(thing, add, profile.status.extTemperature.sensor1 != null, CHGR_SENSOR, CHANNEL_ESENSOR_TEMP1);
addChannel(thing, add, profile.status.extTemperature.sensor2 != null, CHGR_SENSOR, CHANNEL_ESENSOR_TEMP2);
Expand Down

0 comments on commit 5c23fae

Please sign in to comment.