Skip to content

Commit 7cf77e3

Browse files
authored
Merge pull request #1132 from webrtcHacks/ignore-rn
Bail out early if navigator.userAgent is not set
2 parents 17465a1 + 7bfe554 commit 7cf77e3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/js/utils.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ export function detectBrowser(window) {
153153
const result = {browser: null, version: null};
154154

155155
// Fail early if it's not a browser
156-
if (typeof window === 'undefined' || !window.navigator) {
156+
if (typeof window === 'undefined' || !window.navigator ||
157+
!window.navigator.userAgent) {
157158
result.browser = 'Not a browser.';
158159
return result;
159160
}

0 commit comments

Comments
 (0)