Skip to content

Commit

Permalink
[items] Fix posting/commanding Item with undefined
Browse files Browse the repository at this point in the history
An error was thrown when undefined was sent to an Item, due to missing
handling of it.

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
  • Loading branch information
florian-h05 committed Dec 22, 2023
1 parent 16bec67 commit b30c794
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions items/items.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const DYNAMIC_ITEM_TAG = '_DYNAMIC_';
*/
function _toOpenhabString (value) {
if (value === null) return 'NULL';
if (value === undefined) return 'UNDEF';
if (typeof value === 'number' || typeof value === 'string') {
return value;
} else if (typeof value.toOpenHabString === 'function') {
Expand Down

0 comments on commit b30c794

Please sign in to comment.