Joery-M / Govee-LAN-Control

An Node.js package to control Govee devices with LAN
https://joery.com/govee-lan-control
MIT License
21 stars 4 forks source link

App crahes on undefined device #12

Open kaohlive opened 2 months ago

kaohlive commented 2 months ago

https://github.com/Joery-M/Govee-LAN-Control/blame/d70fa444f0da8081da8ba451a6807c598f06c81d/src/index.ts#L308 This line is giving me crashes ones in a while.

TypeError: Cannot read properties of undefined (reading 'state') at Socket.receiveMessage (/app/node_modules/govee-lan-control/dist/index.js:531:57) at Socket.emit (node:events:517:28) at UDP.onMessage [as onmessage] (node:dgram:942:8)

Since its the event emitter part of the code I also dont think I can catch these errors in my own app that is using your module.