stfnhmplr / homee-api

a library to interact with homee
39 stars 6 forks source link

TypeError Cannot read property 'attributes' of undefined #7

Closed Apollon77 closed 4 years ago

Apollon77 commented 4 years ago

Hi, this one was reported by Sentry, but should be an edge case ... still checking for it should be easy ...

https://sentry.iobroker.net/share/issue/2d940ba4ffdd45a7b33c0691c3ba9274/

TypeError: Cannot read property 'attributes' of undefined
  File "/opt/iobroker/node_modules/homee-api/homee.js", line 298, col 50, in Homee.handleAttributeChange
    const attributeIndex = this.nodes[nodeIndex].attributes.findIndex(
  File "/opt/iobroker/node_modules/homee-api/homee.js", line 252, col 14, in Homee.handleMessage
    this.handleAttributeChange(message.attribute);
  File "/opt/iobroker/node_modules/homee-api/homee.js", line 186, col 12, in WebSocket.ws.on
    this.handleMessage(JSON.parse(message));
  File "events.js", line 198, col 13, in WebSocket.emit
  File "domain.js", line 448, col 20, in WebSocket.EventEmitter.emit
  File "/opt/iobroker/node_modules/homee-api/node_modules/ws/lib/websocket.js", line 801, col 20, in Receiver.receiverOnMessage
    this[kWebSocket].emit('message', data);
  File "events.js", line 198, col 13, in Receiver.emit
  File "domain.js", line 448, col 20, in Receiver.EventEmitter.emit
  File "/opt/iobroker/node_modules/homee-api/node_modules/ws/lib/receiver.js", line 436, col 14, in Receiver.dataMessage
    this.emit('message', buf.toString());
  File "/opt/iobroker/node_modules/homee-api/node_modules/ws/lib/receiver.js", line 366, col 17, in Receiver.getData
    return this.dataMessage();
stfnhmplr commented 4 years ago

Thanks for reporting 👍