Skip to content

Commit 29967b7

Browse files
author
Robert Jackson
authored
Fix Cannot read property '1' of undefined exception (#9)
Fix `Cannot read property '1' of undefined` exception
2 parents 0d97318 + 0b5fe1d commit 29967b7

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/gather/gather-telemetry.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,11 @@ module.exports = async function gatherTelemetry(url) {
127127
);
128128

129129
const observerProperties = observedProperties.reduce((acc, oProp) => {
130-
const listener = meta.matchingListeners(`${oProp}:change`)[1];
131-
acc[listener] = [].concat(acc[listener] || [], [oProp]);
130+
const listenerData = meta.matchingListeners(`${oProp}:change`);
131+
if (listenerData) {
132+
const listener = listenerData[1];
133+
acc[listener] = [].concat(acc[listener] || [], [oProp]);
134+
}
132135
return acc;
133136
}, {});
134137

0 commit comments

Comments
 (0)