From 9ec028b98cbf0d52a036b076ef1098dc5a531ff4 Mon Sep 17 00:00:00 2001 From: christian-bromann Date: Tue, 3 Feb 2015 18:09:40 +0100 Subject: [PATCH] make sure to only parse numer or strings to intergers --- lib/browser/startAnalyzing.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/browser/startAnalyzing.js b/lib/browser/startAnalyzing.js index 53b1e87..85036b3 100644 --- a/lib/browser/startAnalyzing.js +++ b/lib/browser/startAnalyzing.js @@ -41,7 +41,11 @@ module.exports = function(_, pcSelectorMethod, interval) { * sanitize stat values */ function sanitize(val) { - return parseInt(val || 0, 10); + if(typeof val !== 'string' && typeof val !== 'number') { + return undefined; + } + + return parseInt(val, 10); } /**