diff --git a/lib/precondition.js b/lib/precondition.js index 1781449..070beea 100644 --- a/lib/precondition.js +++ b/lib/precondition.js @@ -7,7 +7,7 @@ module.exports = function (iterations, keylen) { throw new TypeError('Iterations not a number'); } - if (iterations < 0) { + if (iterations < 0 || !Number.isFinite(iterations)) { throw new TypeError('Bad iterations'); }