From 71db396bc558daa5ac24770d349cbf8127baf1fe Mon Sep 17 00:00:00 2001 From: Jordan Porter Date: Thu, 19 Sep 2024 08:24:32 -0600 Subject: [PATCH] Update src/features/session_replay/shared/recorder.js Co-authored-by: Chunwai Li --- src/features/session_replay/shared/recorder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/session_replay/shared/recorder.js b/src/features/session_replay/shared/recorder.js index 09316931b..fd56c5552 100644 --- a/src/features/session_replay/shared/recorder.js +++ b/src/features/session_replay/shared/recorder.js @@ -74,7 +74,7 @@ export class Recorder { const { block_class, ignore_class, mask_text_class, block_selector, mask_input_options, mask_text_selector, mask_all_inputs, inline_images, collect_fonts } = getConfigurationValue(this.parent.agentIdentifier, 'session_replay') const customMasker = (text, element) => { try { - if (element?.type?.toLowerCase?.() !== 'password' && (element?.dataset?.nrUnmask !== undefined || element?.classList?.contains('nr-unmask'))) return text + if (typeof element?.type === 'string' && element.type.toLowerCase() !== 'password' && (element?.dataset?.nrUnmask !== undefined || element?.classList?.contains('nr-unmask'))) return text } catch (err) { // likely an element was passed to this handler that was invalid and was missing attributes or methods }