Skip to content

Commit

Permalink
fix: targetselector null safety
Browse files Browse the repository at this point in the history
  • Loading branch information
ekremney committed Apr 18, 2024
1 parent 6354b26 commit 2ab6f0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ function addCWVTracking() {
data.cwv[measurement.name] = measurement.value;
if (measurement.name === 'LCP' && measurement.entries.length > 0) {
const { element } = measurement.entries.pop();
data.target = sampleRUM.targetselector(element);
data.source = sampleRUM.sourceselector(element) || element.outerHTML.slice(0, 30);
data.target = targetselector(element);
data.source = sourceselector(element) || element.outerHTML.slice(0, 30);
}
sampleRUM('cwv', data);
};
Expand Down

0 comments on commit 2ab6f0e

Please sign in to comment.