Skip to content

Commit 888db8e

Browse files
committed
Misc "?." for safety
1 parent d77473b commit 888db8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/pages/_app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export function reportWebVitals(metrics: NextWebVitalsMetrics): void {
125125
const { name } = metrics;
126126
const count = globalWebVitalsMetric.reportedCount;
127127
globalWebVitalsMetric.metrics[name] = metrics;
128-
const keysLength = Object.keys(globalWebVitalsMetric.metrics).length;
128+
const keysLength = Object.keys(globalWebVitalsMetric.metrics)?.length;
129129

130130
// Temporise analytics API calls by waiting for at least 5 metrics to be received before sending the first report
131131
// (because 3 metrics will be received upon initial page load, and then 2 more upon first click)

0 commit comments

Comments
 (0)