Skip to content

Commit

Permalink
fix: make targetselector null safe
Browse files Browse the repository at this point in the history
  • Loading branch information
ekremney committed Apr 18, 2024
1 parent 98af562 commit e036f37
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ new PerformanceObserver((list) => list
.observe({ type: 'navigation', buffered: true });

sampleRUM.targetselector = (element) => {
if (!element) return undefined;
let value = element.getAttribute('data-rum-target') || element.getAttribute('href') || element.currentSrc || element.getAttribute('src')
|| element.dataset.action || element.action;
if (value && !value.startsWith('https://')) {
Expand Down

0 comments on commit e036f37

Please sign in to comment.