Skip to content

Commit

Permalink
fix: safe check
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Feb 12, 2024
1 parent e812eef commit be93eb1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/lib/ZwaveClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5368,7 +5368,7 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
if (zwaveNode.ready) {
const res = this._addValue(zwaveNode, args)

if (res.valueId) {
if (res?.valueId) {
const node = this._nodes.get(zwaveNode.id)
this.subscribeObservers(node, res.valueId)
}
Expand Down Expand Up @@ -6229,7 +6229,8 @@ class ZwaveClient extends TypedEventEmitter<ZwaveClientEventCallbacks> {
if (!valueId) {
// node name and location emit a value update but
// there could be no defined valueId as not all nodes
// support that CC but zwave-js does (https://github.com/zwave-js/zwave-js-ui/issues/3591)
// support that CC but zwave-js does, also we ignore it
// on `_valueAdded`. Ref: (https://github.com/zwave-js/zwave-js-ui/issues/3591)
if (
args.commandClass ===
CommandClasses['Node Naming and Location']
Expand Down

0 comments on commit be93eb1

Please sign in to comment.