Skip to content

Commit

Permalink
fix: fallback to "<environment unknown>" if navigator is undefined (
Browse files Browse the repository at this point in the history
  • Loading branch information
olivernybroe authored Feb 21, 2020
1 parent d296069 commit d45e9dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/browser.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
export function getUserAgent(): string {
return navigator.userAgent;
try {
return navigator.userAgent;
} catch (e) {
return "<environment unknown>"
}
}

0 comments on commit d45e9dd

Please sign in to comment.