diff --git a/lib/core/utils/uuid.js b/lib/core/utils/uuid.js index b52b113c3d..c172988a48 100644 --- a/lib/core/utils/uuid.js +++ b/lib/core/utils/uuid.js @@ -24,10 +24,10 @@ if (!_rng && _crypto && _crypto.getRandomValues) { } try { - if (!_rng && require) { - const nodeCrypto = require('crypto'); - _rng = () => nodeCrypto.randomBytes(16); - } + if (!_rng) { + const nodeCrypto = require('crypto'); + _rng = () => nodeCrypto.randomBytes(16); + } } catch (e) { /* do nothing */ }