Skip to content

Commit

Permalink
fix(entity): check for current connectin before attempting to access it
Browse files Browse the repository at this point in the history
  • Loading branch information
zachowj committed Dec 31, 2020
1 parent 94d603d commit 53cdb93
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nodes/entity/entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ module.exports = function (RED) {
setConnectionStatus(additionalText) {
if (this.nodeConfig.entityType === 'switch') {
let status = this.getConnectionStatus();
if (this.connectionState === this.websocketClient.CONNECTED) {
if (
this.websocketClient &&
this.connectionState === this.websocketClient.CONNECTED
) {
status = {
shape: this.isEnabled ? 'dot' : 'ring',
fill: 'blue',
Expand Down

0 comments on commit 53cdb93

Please sign in to comment.