From dc583bd556604ed2927fa239a2b1f4bb94d25d0c Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Tue, 1 Feb 2022 17:24:51 +0100 Subject: [PATCH] Check existence of `navigator` before using it --- src/util.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/util.js b/src/util.js index c62c09149..b3ff14583 100644 --- a/src/util.js +++ b/src/util.js @@ -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) {