openhab / openhab-js

openHAB JavaScript Library for JavaScript Scripting Automation
https://www.openhab.org/addons/automation/jsscripting/
Eclipse Public License 2.0
38 stars 31 forks source link

[rules] Fix EventObject.itemName `null` is `string` instead of `null` #134

Closed florian-h05 closed 2 years ago

florian-h05 commented 2 years ago

Fixes an issue that I introduced in #125.

I added toString() to event.itemName, but this made null checks fail because even null is now a string. I double checked, and itemName is also string if I remove toString().

Signed-off-by: Florian Hotze florianh_dev@icloud.com

florian-h05 commented 2 years ago

@digitaldan Can you review?

digitaldan commented 2 years ago

👍

florian-h05 commented 2 years ago

@digitaldan I know that I am too late, but I found out that the problem was not only my previous PR #125, but the problem is in the getTriggeredData function itself, therefore I am currently doing further investigation and I will refactor that method completely.