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 92883ef commit 12e3f0c
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 @@ -22,6 +22,7 @@ const urlSanitizers = {
};

const 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 12e3f0c

Please sign in to comment.