DeviceReport: don't crash on binds to non-existing entities. #3245

This commit is contained in:
Koen Kanters
2020-03-30 19:50:35 +02:00
parent 1ca34536de
commit 7131c05255
+2 -1
View File
@@ -182,7 +182,8 @@ class DeviceReport extends BaseExtension {
let toPoll = [];
// Add bound devices
toPoll = toPoll.concat([].concat(...message.device.endpoints.map((e) => e.binds.map((e) => e))));
toPoll = toPoll.concat([].concat(...message.device.endpoints.map((e) =>
e.binds.map((e) => e).filter((e) => e.target))));
toPoll = toPoll.filter((e) => e.target.constructor.name === 'Endpoint');
toPoll = toPoll.filter((e) => e.target.getDevice().type !== 'Coordinator');
toPoll = toPoll.map((e) => e.target);