Skip to content

Commit

Permalink
fix: make targetselector null safe (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekremney authored Apr 18, 2024
1 parent 1e876f2 commit 6f8e117
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;
const getTargetValue = (el) => el.getAttribute('data-rum-target') || el.getAttribute('href')
|| el.currentSrc || el.getAttribute('src')
|| el.dataset.action || el.action;
Expand Down

0 comments on commit 6f8e117

Please sign in to comment.