Add undefined check for navigator.userAgent

This commit is contained in:
Peter Mulholland
2020-04-23 16:08:48 -04:00
parent e7968bcc1a
commit 6008449e07

View File

@@ -3,7 +3,9 @@
*/
const ua =
typeof navigator !== 'undefined' ? navigator.userAgent.toLowerCase() : '';
typeof navigator !== 'undefined' && typeof navigator.userAgent !== 'undefined'
? navigator.userAgent.toLowerCase()
: '';
/**
* User agent string says we are dealing with Firefox as browser.