Skip to content

Commit

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

return navigator.hardwareConcurrency || 1;
return (typeof navigator !== 'undefined' && navigator.hardwareConcurrency) || 1;
},

isEmailAddress: function(data) {
Expand Down

0 comments on commit f93f59e

Please sign in to comment.