Skip to content

Commit 03b943d

Browse files
[cpuprofiler] Check navigator variable before usage (#21698)
1 parent d5da2c4 commit 03b943d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cpuprofiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// That doesn't work for Chrome in turn, so need to resort to user agent
1616
// sniffing.. (sad :/)
1717
if (!performance.realNow) {
18-
var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
18+
var isSafari = typeof navigator !== 'undefined' && /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
1919
if (isSafari) {
2020
var realPerformance = performance;
2121
performance = {

0 commit comments

Comments
 (0)