Skip to content

Commit

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

Signed-off-by: Jacob Laursen <[email protected]>
  • Loading branch information
jlaur committed Dec 18, 2022
1 parent 4871d6d commit 4f3fbca
Showing 1 changed file with 3 additions and 3 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
int relayNum = getInteger(profile.settings.extSwitch.input0.relayNum);
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));
profile.settings.extSwitch != null && profile.settings.extSwitch.input0 != null && idx == relayNum,
CHGR_SENSOR, CHANNEL_ESENSOR_INPUT + (relayNum + 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 4f3fbca

Please sign in to comment.