All my Aeotec Z-Wave Smart Switches not working

That’s because the “hotfix” did not revert the broken code … Apparently only a bandaid was applied (IMHO)… i.e., protection against fatal NPE, not a fix of the underlying assumptions and non-NPE consequences.

whats NPE?

Null Pointer Exception… generally results in a fatal error.

The Device Handler was aborting due to the conditional statement expecting a value or object that doesn’t exist (i.e., the referenced variable is pointing to nothing … null), in some circumstance. Perhaps only for Aeotec devices…

Groovy makes avoiding NPE’s easy by using the ? indicator in the object reference, it will simply return “false” instead of an error.

While that adds some degree of safety, it is not necessarily good programming practise. If a section of code is expecting a value in an object, then there ought to be a reason that the value is expected, and if no value is found, that could be symptom of a serious problem elsewhere in the code. In other words, covering NPE with a bandaid “?” indicator, might really be hiding a festering wound underneath. That’s why strict languages do not provide such shortcuts. Groovy allows sloppy coding. … and yes… this can become a nasty “religious” discussion really quickly.

1 Like

slight change in the message