Skip to content

Commit 85bb9f6

Browse files
authored
fix(utils): Check for performance.now() when calculating browser timing (getsentry#3657)
We should guard against performance.now not being available when calculating browserPerformanceTimeOrigin. We do a similar check when for our wrapper around the native performance api implementation.
1 parent d977f35 commit 85bb9f6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/utils/src/time.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export const browserPerformanceTimeOrigin = ((): number | undefined => {
141141
// data as reliable if they are within a reasonable threshold of the current time.
142142

143143
const { performance } = getGlobalObject<Window>();
144-
if (!performance) {
144+
if (!performance || !performance.now) {
145145
_browserPerformanceTimeOriginMode = 'none';
146146
return undefined;
147147
}

0 commit comments

Comments
 (0)