We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0263378 commit 74042a1Copy full SHA for 74042a1
src/attribution/onCLS.ts
@@ -72,7 +72,7 @@ export const onCLS = (
72
layoutShiftManager._onAfterProcessingUnexpectedShift = (
73
entry: LayoutShift,
74
) => {
75
- if (entry.sources.length) {
+ if (entry?.sources?.length) {
76
const largestSource = getLargestLayoutShiftSource(entry.sources);
77
if (largestSource) {
78
const generateTargetFn = opts.generateTarget ?? getSelector;
@@ -88,7 +88,7 @@ export const onCLS = (
88
89
if (metric.entries.length) {
90
const largestEntry = getLargestLayoutShiftEntry(metric.entries);
91
- if (largestEntry?.sources.length) {
+ if (largestEntry?.sources?.length) {
92
const largestSource = getLargestLayoutShiftSource(largestEntry.sources);
93
94
attribution = {
0 commit comments