Skip to content

Commit

Permalink
Check existence of navigator before using it
Browse files Browse the repository at this point in the history
  • Loading branch information
twiss committed Feb 10, 2022
1 parent f54b133 commit dc583bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util.js
Expand Up @@ -430,7 +430,8 @@ const util = {
return os.cpus().length;
}

return navigator.hardwareConcurrency || 1;
// eslint-disable-next-line no-mixed-operators
return typeof navigator !== 'undefined' && navigator.hardwareConcurrency || 1;
},

isEmailAddress: function(data) {
Expand Down

0 comments on commit dc583bd

Please sign in to comment.