souliss / bindingopenhab2

Souliss binding developed for openHAB 2
3 stars 3 forks source link

bug: Prevent NPE when handler can't be obtained. Fixes #14 #15

Closed alvarolobato closed 3 years ago

alvarolobato commented 4 years ago

Found the problem when obtaining the handler for the second slot of a multi-slot typical. In that case I've checked the NPE and set the expected value to -1, I think the result is the same as when entering here: https://github.com/souliss/bindingopenhab2/blame/3abe6b19153b81d1fcc87a6de8a4901340226fc2/org.openhab.binding.souliss/src/main/java/org/openhab/binding/souliss/internal/protocol/SoulissBindingSendDispatcherJob.java#L260

or here: https://github.com/souliss/bindingopenhab2/blame/3abe6b19153b81d1fcc87a6de8a4901340226fc2/org.openhab.binding.souliss/src/main/java/org/openhab/binding/souliss/internal/protocol/SoulissBindingSendDispatcherJob.java#L264

It's working for me.

Closes #14