diff --git a/dist/index.js b/dist/index.js index 5611e38c..503c949c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -433,7 +433,7 @@ var RandomGeneratorUtils = function () { value: function getRandomGenerator() { var randomGenerator = RandomGeneratorUtils.randomGenerator; if (!randomGenerator) { - throw new Error("`randomGenerator` static property is undefined"); + RandomGeneratorUtils.initializeRandomGenerator(0); } return RandomGeneratorUtils.randomGenerator; } diff --git a/src/utils/RandomGeneratorUtils.ts b/src/utils/RandomGeneratorUtils.ts index 5ef0fe08..9985a3b0 100644 --- a/src/utils/RandomGeneratorUtils.ts +++ b/src/utils/RandomGeneratorUtils.ts @@ -58,7 +58,7 @@ export class RandomGeneratorUtils { const randomGenerator: Chance.Chance = RandomGeneratorUtils.randomGenerator; if (!randomGenerator) { - throw new Error(`\`randomGenerator\` static property is undefined`); + RandomGeneratorUtils.initializeRandomGenerator(0); } return RandomGeneratorUtils.randomGenerator;