From 11ee7f8afb99348f1db6d50aa65656e064107d13 Mon Sep 17 00:00:00 2001 From: vlakoff Date: Sat, 29 Oct 2016 10:10:26 +0200 Subject: [PATCH] Void if precision value is not a number --- lib/selectors/simple.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/selectors/simple.js b/lib/selectors/simple.js index 5b8b3392..5e6fd3c1 100644 --- a/lib/selectors/simple.js +++ b/lib/selectors/simple.js @@ -86,7 +86,7 @@ function whitespaceMinifier(name, value) { } function precisionMinifier(_, value, precisionOptions) { - if (precisionOptions.value === -1 || value.indexOf('.') === -1) + if (precisionOptions.value === -1 || isNaN(precisionOptions.value) || value.indexOf('.') === -1) return value; return value @@ -394,6 +394,10 @@ function buildPrecision(options) { precision.value = options.roundingPrecision === undefined ? DEFAULT_ROUNDING_PRECISION : parseInt(options.roundingPrecision); + + if (isNaN(precision.value)) + return precision; + precision.multiplier = Math.pow(10, precision.value); precision.regexp = new RegExp('(\\d*\\.\\d{' + (precision.value + 1) + ',})px', 'g'); -- 2.34.1