Skip to content

Commit

Permalink
Add check is custom not undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
lasthead0 committed May 16, 2022
1 parent a7f46a7 commit 8b7ba67
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,10 @@ class XiaomiGateway3 extends utils.Adapter {

/* set state object if it is not exist or `custom` changed */
if (_stateObject == undefined
|| !objectEquals(stateObject.common.custom[this.namespace], _stateObject.common.custom[this.namespace])
|| (stateObject.common.custom != undefined
&& _stateObject.common.custom != undefined
&& !objectEquals(stateObject.common.custom[this.namespace], _stateObject.common.custom[this.namespace])
)
) {
await this.setObjectAsync(_id, Object.assign({},
{'_id': `${this.namespace}.${_id}`},
Expand Down

0 comments on commit 8b7ba67

Please sign in to comment.