Closed mikeleo closed 3 years ago
I'm not doing much to this code anymore, but if I understand the issue, it sounds like this can be fixed by changing the "if" to something like
if( (HomeSeerData.HomeSeerDevices[myData.ref]) && (HomeSeerData.HomeSeerDevices[myData.ref].notifyObjects !== undefined))
Can you give this a try and see if it works (I am no longer running HomeSeer). If so, I'll add it into the main code and re-publish.
I added the change that I proposed in my prior post to version 1.0.13. If you are still having an issue, re-open this comment and explain further.
In HomeSeer, I rescanned a device that caused an additional child to get added. When I triggered the event, Motion Sensor on a Switch, it appears this correlated with a crash in the plugin.
Looking at the line in question,
the code is not checking if the myData.ref is present in the HomeSeerData.HomeSeerDevices array before further checking if the notifyObjects is present. An option to address issue might be to reload the HomeSeerData.HomeSeerDevices if the reference is not present. In the odd case it isn't still present after reload, there might need to be consideration of logging error and stubbing the device to prevent continuous reloading.