Skip to content

Commit 48dbff8

Browse files
committed
added null-safe operators (?.) to prevent the "Cannot read properties
of null" error in the getMeasurements function at shiny-tic-toc.js:170-174
1 parent 6e8ce53 commit 48dbff8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

shiny-tic-toc.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,9 @@ function getMeasurements() {
168168
typeof entry.duration === 'number' &&
169169
typeof entry.startTime === 'number')
170170
.map(entry => ({
171-
name: entry.name,
172-
duration: entry.duration,
173-
startTime: entry.startTime
171+
name: entry?.name || '',
172+
duration: entry?.duration || 0,
173+
startTime: entry?.startTime || 0
174174
}));
175175
}
176176

0 commit comments

Comments
 (0)