Bläddra i källkod

Added RandomGenerator clearing after obfuscation

sanex3339 8 år sedan
förälder
incheckning
4e5cf5ad0d
2 ändrade filer med 2 tillägg och 2 borttagningar
  1. 1 1
      dist/index.js
  2. 1 1
      src/utils/RandomGeneratorUtils.ts

+ 1 - 1
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;
         }

+ 1 - 1
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;