diff --git a/packages/honeycomb-opentelemetry-web/src/web-vitals-autoinstrumentation.ts b/packages/honeycomb-opentelemetry-web/src/web-vitals-autoinstrumentation.ts index 5efaba97..2fa84ec9 100644 --- a/packages/honeycomb-opentelemetry-web/src/web-vitals-autoinstrumentation.ts +++ b/packages/honeycomb-opentelemetry-web/src/web-vitals-autoinstrumentation.ts @@ -483,7 +483,7 @@ export class WebVitalsInstrumentation extends InstrumentationAbstract { }); const el: HTMLElement = lcpEntry?.element as HTMLElement; - if (el.dataset) { + if (el?.dataset) { for (const attrName in el.dataset) { const attrValue = el.dataset[attrName]; if (