velocityzen / homebridge-platform-zwave

Homebridge Platform for Z-Wave nodes. Deprecated! Use node-red instead.
MIT License
13 stars 6 forks source link

Fixed crash caused by cleanupAccessoriesIds becoming unset #4

Closed shnhrrsn closed 4 years ago

shnhrrsn commented 4 years ago

Every time I add a new accessory the platform was crashing:

[12/28/2019, 4:15:26 PM] TypeError: Cannot read property 'delete' of undefined
    at Platform.onNodeAdded (/app/plugins/node_modules/homebridge-platform-zwave/platform/index.js:70:32)
    at Object.onNodeAdded (/app/plugins/node_modules/homebridge-platform-zwave/platform/index.js:33:35)
    at Controller.onNodeAdded (/app/plugins/node_modules/homebridge-platform-zwave/zwave/controller.js:304:48)
    at OZW.<anonymous> (/app/plugins/node_modules/homebridge-platform-zwave/zwave/controller.js:65:61)
    at OZW.emit (events.js:210:5)

I traced it to Platform.cleanupAccessories unsetting the cleanupAccessoriesIds set rather than clearing it out.