Skip to content

Commit

Permalink
Check that navigator is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
nickuraltsev committed Mar 2, 2017
1 parent 603bd2f commit 5df39d8
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/utils.js
Expand Up @@ -169,7 +169,6 @@ function trim(str) {
*
* This allows axios to run in a web worker, and react-native.
* Both environments support XMLHttpRequest, but not fully standard globals.
* As of react-native 0.13, it can be identified from navigator.product.
*
* web workers:
* typeof window -> undefined
Expand All @@ -179,7 +178,7 @@ function trim(str) {
* navigator.product -> 'ReactNative'
*/
function isStandardBrowserEnv() {
if (typeof navigator.product !== 'undefined' && navigator.product === 'ReactNative') {
if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
return false;
}
return (
Expand Down

0 comments on commit 5df39d8

Please sign in to comment.